A government accountant whose ineptitude and inexperience allowed Bernie Madoff’s Ponzi scheme to rage unchecked actually landed a cash bonus from his bosses at the SEC — for his work on none other than the Madoff case.

Peter Lamore, 39, was awarded a $1,200 payout last year, even though he and the higher-up who approved his bonus “were subject to potential disciplinary action at the time” for their dismally subpar performance in the Madoff case, according to a scathing Aug. 2 review by the SEC’s inspector general.

Lamore — a compliance officer in the Securities and Exchange Commission’s New York City office during the flawed 2005 examination of Madoff and his cooked books — was never actually punished for his shoddy work.

But government investigators who dissected the biggest Ponzi scheme in history found that Lamore’s review of Madoff was “inappropriately focused, conducted without obtaining critical independent data, closed with unresolved issues remaining, and relied too heavily on” Madoff’s bogus explanations, according to their massive August 2009 report.

Lamore was nominated for his bonus just two weeks after he was taken to task along with others in the 2009 report — and nine months after Madoff’s Ponzi scheme burst into the headlines.

Amazingly, Lamore had already been promoted to SEC staff accountant in 2006 thanks, in part, to his inspection of Madoff’s books, auditors found.

Lamore’s name was omitted from the new IG’s report because of personnel-confidentiality rules. But his ID was pinned down by The Post and independently confirmed by sources.

The audit said Lamore was nominated for the bonus “to reward the employee’s efforts in 2009 pertaining to a follow-on investigation of Madoff.”

A graduate of the Coast Guard Academy with an MBA from NYU, Lamore, of Stamford, Conn., did not respond to calls or an e-mail seeking comment.