District Mayor Vincent C. Gray is almost certainly going to have to resign in disgrace, and possibly soon, but it’s unclear whether he’s fully aware of that fact.

Instead, because of a mix of pride and stubbornness, the mayor appears to be in denial about the likelihood that the current avalanche of revelations of corruption in his 2010 campaign is going to carry him away.

It’s conceivable that Gray (D) knows full well he’s on his way out and is just posing as an innocent to buy time. In that case, his goal could be to cut a deal with U.S. Attorney Ronald C. Machen Jr. to give up his office in exchange for avoiding legal charges.

But both Gray’s public comments and private conversations with associates suggest that he’s convinced himself that he did nothing wrong — or at least nothing for which Machen can catch him.

The mayor acts as if everyone will eventually accept that he was just out of the loop while his biggest campaign donor and some of his closest associates orchestrated the largest election fraud in 39 years of District home rule.

Mayor Vincent Gray wipes his brow during his weekly press conference in an alley on Wednesday as members of the D.C. Council began calling for his resignation. (Daniel C. Britt/THE WASHINGTON POST)

“In my conversations with the mayor over the past few days, he is very resolute in ensuring that he continues to lead,” D.C. Chamber of Commerce President Barbara Lang, a Gray supporter, said Friday.

“I’ve seen no indication at all — and I’ve asked — that there is any exit strategy,” Lang said.

Gray should start finding one, for his sake and that of the District. I wrote in late May that Gray should resign unless he could explain to the District’s citizens what went wrong in his campaign. Now he’s got much more to explain, but he’s still offering just a sketchy, implausible defense. Delaying the inevitable only aggravates the city’s agony.

People with experience in District politics were stunned at the size of the corrupt “shadow campaign,” confirmed Tuesday. It was funded by $650,000 of illegal contributions from city contractor Jeffrey Thompson.

“That is a ton of money. That was over a quarter of what we raised in total for the legitimate, official campaign,” said Mo Elleithee, a communications strategist who advised the legal part of Gray’s effort. “If I’d had another $600,000 in legitimate money, that would have bought me an entire additional week of television ads.”

Compare that sum with one in a recent scandal just up the freeway. In 2010, Baltimore Mayor Sheila Dixon was forced from office after being convicted on a misdemeanor of embezzling retail gift cards worth about $600.

There’s no “smoking gun” yet in the District — a witness’s testimony or documentary evidence — to show that the mayor knew about the illegal funding during the campaign.

But Gray isn’t plainly denying it. In his Friday television interview with NewsChannel 8’s Bruce DePuyt, he evaded two direct questions about whether he knew about the “shadow campaign” when it was happening.

Gray tried to fuzz up the issue by saying he “set out to run a campaign with integrity” without describing how that alleged plan went astray.

He also said he was too busy being D.C. Council chairman to make sure his subordinates in the campaign were being honest. But that doesn’t square with the fact that the council was in recess in 2010 for most of the time from mid-July to the primary’s Election Day in September.

Gray also had the gall to stress his purported desire to be open and transparent with the public, when all his behavior says he’s being closed and secretive.

It’s hard to judge how much longer this painful drama will last. Machen has been relentless recently, obtaining three guilty pleas in less than eight weeks. Some legal experts believe that the prosecutor will try to wrap up the case by early fall to avoid getting involved in the run-up to the November election.

Meanwhile, people who know the mayor are stressing his ability to “compartmentalize” and stay focused on his day-to-day duties despite the scandal. Top politicians said they’re amazed at Gray’s ability to maintain his cool at public events.

But “compartmentalization” also takes the form of self-delusion and rationalization, traits Gray is displaying to an increasing degree.

“I think he thinks he’s a good guy and always tries to do the right thing, so he can do these other things even when the results aren’t right,” said a city official and longtime Gray observer who spoke on the condition of anonymity to freely criticize the mayor.

I suppose there’s still some faint possibility of a dramatic turnaround that vindicates Gray, but no available evidence supports that prospect. Most likely, he’ll have to wrap his brain around the reality that he’s headed prematurely back to private life, and possibly to prison.

For previous columns by Robert McCartney, go to washingtonpost.com/mccartney.