I owe Ray Nagin an apology. All this time I’ve been saying how clueless and feckless the former mayor is. Little did I know that was all an act. Turns out he’s as sharp as Frank Fradella and Greg Meffert.

Who knew?

While I’m apologizing to Nagin, I should also thank U.S. Attorney Jim Letten and the Justice Department for finally letting us all know just how cunning Nagin really is. I’m sure Nagin will want to thank them as well, considering how his reputation as a moron was, um, etched in stone until now.

For some reason, Nagin was silent this week when the feds disclosed, via a bill of information and plea deal, that he and Fradella masterminded a scheme to channel millions of federally funded city contracts to Fradella’s companies in exchange for thousands of dollars in cash to Nagin and tons of granite to Stone Age LLC, the Nagin family countertop company.

And to think, we all thought Nagin was some dumbass who didn’t even know who was paying for his trips to Hawaii and Jamaica. I gotta admit, he had me fooled. Guess all those cable TV shows he hosted before he ran for office sharpened his acting skills - and hanging around with high-flying Mensa types like Meffert and Fradella convinced him of the wisdom of keeping his own genius under wraps.

Another well-kept secret was Nagin’s virtuosity as a businessman. True, he sold himself to voters as just that when he ran for mayor in 2002, but Hurricane Katrina and its aftermath seemed to give the lie to that. Well, now we know he was just proving his chops as a master of understatement, hiding his moneymaking wizardry behind a carefully crafted façade of insouciant narcissism and smug incompetence.

Man, this guy is good.

According to Fradella’s plea in federal court last week, he and Nagin devised a clever plan for Nagin to earn at least $50,000 in bribes - I mean consulting fees, or was that for stock? Gosh, I’m just dazzled by the guy’s brilliance.

Anyway, Nagin clearly wasn’t idling his time away as mayor, contrary to what we all thought - and what he projected. No sir. A regular John D. Rockefeller this guy was. Maybe even a Keyser Söze. Consider that even now the feds obliquely refer to him as “Public Official A.” Talk about instilling fear in people. I bet Letten gets the willies just thinking about him.

And why not? According to the feds:

• He had his hand in the family countertop biz, which got “numerous truckloads” of free granite from Fradella, who in turn got truckloads of cash from post-Katrina city contracts.

• He got a $50,000 bribe in 2008 via a money-laundering scheme involving Fradella and Michael McGrath, a corrupt mortgage banker-turned-corporate board chair for Fradella’s equally corrupt Home Solutions of America. According to the feds, Nagin shrewdly disguised the payoff as a business transaction involving Stone Age.

• Even after leaving office, Nagin continued to collect payments from Fradella via a “consulting agreement and monthly payments in excess of $10,000.” Remember how we all scoffed at him for hanging out a consultant’s shingle after his term as mayor ended?

Guess he showed us.

So here it is: I apologize to Ray Nagin. I’m sorry I called him a dummy all those times. I should have known he was really the Keyser Söze of New Orleans. And like the legendary Hollywood villain, the greatest trick he ever pulled was convincing us all he was a clueless, feckless peacock.

Now we know: he’s a stone-cold genius.