In the early moments after Vincent C. Gray’s primary loss, a key talking point emerged from the deposed mayor and his supporters: Without the decision of U.S. Attorney Ronald C. Machen Jr. to file a sweetheart plea deal with businessman Jeffrey E. Thompson on March 10, Gray would have been able to squeeze out a primary win.

That plea deal, which included new allegations that Gray knew of and participated in the secret spending against him, unfairly turned the tide against him and amounted to an improper influence on an impending election, Gray’s camp said.

Said campaign manager Chuck Thies, “One thing changed this election: Ron Machen,” he said. “Why create the made-for-Twitter ‘Uncle Earl’ moment? … Why create a dog-and-pony show around a plea deal? The answer to the question is, to influence an election, and that’s not the job of prosecutors. We were up in every public poll before ‘Machen Monday.'”

Gray himself compared his circumstance to last year’s race to replace former Virginia Gov. Robert F. McDonnell (R). “You had a gubernatorial race, didn’t even involve the incumbent,” he said. “But that investigation stopped until that race was over. And I think it’s commonplace for these kinds of investigations to not have some kind of influence on the outcome of an election.”

And Gray supporter Marion Barry tweeted Tuesday night, about a half-hour after Gray’s concession, “Ron Machen decided this election.”

But, absent the Thompson plea, would Gray have been able to eke out a victory? Washington Post polling suggests his road to reelection was already remarkably treacherous before the plea deal, and that Gray’s political fundamentals changed little afterward.

Two Post polls — one performed in early January, another in mid-March — provide valuable snapshots of public opinion before and after the deal. Yes, Gray was leading in the January poll, with 27 percent support among likely voters, compared to roughly half as much support shared by each of his three leading D.C. Council challengers.

But in January there were unmistakable indications that Gray’s room to grow was limited, and that the investigation had already stiffened voters’ resolve to replace Gray. For instance: 57 percent of registered Democrats said in January that Gray was not honest and trustworthy; that ticked up slightly after the Thompson plea, to 62 percent. Nearly nine in 10 Democratic voters had clear impressions of Gray by January, compared with half or less for his leading challengers.

Meanwhile, voters were already focused on the investigation as a key factor in their voting decision: Half of likely voters said in January that the inquiry would be a major factor in their decisions; that did not increase at all after the plea deal. While Gray’s job approval did decline by a significant margin after the plea deal, his level of support in the mayoral race held fast at 27 percent among likely voters.

So for Gray to have pulled out a victory, he would have had to continue to benefit from a closely split field. But there is no guarantee that that would have been the case, even without the Thompson plea.

There is plenty of historical precedent in the District for voters coalescing around a single challenger late in a race. In the 1990 mayoral primary, for instance, Sharon Pratt trailed in polls before a series of Washington Post endorsements helped separate her from her rivals. In the 1998 primary, Anthony A. Williams broke out from a pack that included D.C. Council members Kevin Chavous, Jack Evans and Harold Brazil only in the final weeks of the race — again based on the Post endorsement and late polling.

Furthermore, there is evidence voters started turning toward Bowser at least two weeks before the Thompson plea was unveiled. A poll conducted between Feb. 16 and Feb. 23 by WRC-TV, WAMU-FM, The Washington Informer and Marist College showed Bowser emerging ahead of her rivals and closing the gap with Gray. And note that Bowser was endorsed by The Post on Feb. 20, about halfway through the survey period and before she plastered that nod on tens of thousands of direct mail pieces that would later blanket the city.

While the Thompson plea may have played a role in accelerating Bowser’s ability to gather anti-Gray votes behind her, it was not the chief cause of his loss. And while it is fair to question Machen’s decision to sign and unveil the deal three weeks ahead of the election, Bowser’s 11-percentage-point victory margin makes it hard to posit that Gray — stuck at the same level of voter support before and after — could have made up that kind of ground absent the prosecutor’s doings.

Scott Clement and Aaron Davis contributed to this post.