The U.S. Attorney General's office announced Wednesday that it is ending its long-running investigation into former D.C. mayor Vincent Gray's 2010 campaign. (WUSA9)

Former D.C. mayor Vincent C. Gray will not be charged after a years-long federal probe into the illegal financing of his 2010 campaign, as prosecutors announced the end of the investigation Wednesday.

The city’s top prosecutor, U.S. Attorney Channing D. Phillips, closed out the probe that has cast a long shadow over District politics, saying that the office likely did not have enough “admissible evidence” to secure any additional convictions.

The decision to shut down the investigation that led to the prosecution of a dozen people connected to Gray’s campaign or to the once-powerful city contractor, Jeffrey E. Thompson, was a stunning turnaround for the U.S. Attorney’s Office. In March 2014, it essentially forecast a prosecution of Gray by accusing him of having detailed knowledge of a corrupt, off-the-books campaign fund. And it did so just weeks before the Democratic primary, in which Gray, then the mayor, was effectively ousted by Muriel E. Bowser, who went on to win the general election.

Gray and his supporters blamed the timing of prosecutors’ allegations for his defeat.

More recently, after the two men who launched and oversaw the investigation resigned, charges against the 73-year-old former mayor have seemed less certain. Phillips, who is awaiting confirmation by the Senate, was nominated for the U.S. attorney’s job this fall.

In this 2013 video, reporter Nikita Stewart explains Jeffrey Thompson's significance in D.C. politics and connections to key figures. (The Washington Post)

Throughout the investigation, Gray vigorously denied any wrongdoing. In September 2014, he rejected a proposal from federal prosecutors that he plead guilty to a single felony count.

“Justice delayed is justice denied, but I cannot change history,” Gray said in a statement Wednesday. “I look forward to getting on with the next chapter of my life, which will no doubt be dedicated to service.”

Since 2012, six people — including several of the mayor’s top associates — have pleaded guilty to federal crimes directly related to secret funding for Gray’s mayoral campaign.

But most have yet to be sentenced after making plea deals in which they agreed to assist prosecutors in exchange for recommendations of leniency. On Wednesday, Phillips’s office formally asked to set sentencing dates for the defendants no sooner than Feb. 17.

The announcement ending the probe came in an emailed statement that provided few details about the office’s decision. Phillips declined to elaborate, but in a subsequent statement, he raised the possibility that prosecutors might reveal more to judges in coming months about the reasoning behind their decision.

If Wednesday’s decision allows Gray to assert his innocence and mount a political comeback, the statement also left room for critics to continue to question his role in the illicit campaign-financing scheme.

In this video from a 2014 news conference, then-U.S. Attorney Ronald C. Machen Jr. announced that D.C. contractor Jeffrey Thompson had admitted to funneling milllions in illegal contributions to local and federal campaigns. On Wednesday, the current U.S. Attorney announced he was closing the investigation into former D.C. Mayor Vincent C. Gray's 2010 campaign. (WUSA9)

“The ex-mayor is a lucky guy” to emerge standing from a “case study of how municipal corruption occurs in a major city,” said Joseph E. diGenova, U.S. attorney for the District from 1983 to 1988. “The U.S. Attorney’s Office was forced to investigate this matter because a city election was corrupted by a group of people, including the former mayor, who was either willfully ignorant or complicit, regardless of whether or not there was criminal liability.”

It is not uncommon, former prosecutors said, for the government to secure plea deals and cooperation from lower-level defendants but ultimately decide not to charge the target at the top.

What was unusual, according to former prosecutors, was the half-hour televised news conference at which the former U.S. attorney appeared to telegraph that the mayor was the office’s next target.

“It’s hard to see how this doesn’t come across as being deeply unfair to the mayor. If you’ve got the goods, you bring them. If not, you don’t say anything,” said Peter R. Zeidenberg, a partner at Arent Fox and former prosecutor in the Justice Department’s Public Integrity Section.

“I know these cases can be extremely tedious to do, but someone should have pulled the plug on this thing a long time ago. It’s an embarrassment to the office.”

In a statement Wednesday, Phillips’s predecessor, Ronald C. Machen Jr., defended his office’s record on public corruption, saying he was proud of the investigation that “stopped the flow of illegal corporate cash that had poisoned D.C. politics for years.”

Machen said that the probe was “active and ongoing” when he stepped down and that he could not comment on the decision to forgo charges.

Closing the probe now would appear to leave prosecutors in a potentially tricky position. If the defendants have been truthful, as required by their plea agreements, prosecutors will tell the judges that the individuals still deserve reduced sentences. But it is unclear whether prosecutors will also be expected to explain why, if they believe the defendants, their office is not bringing a case against Gray.

Thompson has admitted illegally funneling more than $653,000 to a secret get-out-the-vote effort in support of Gray’s 2010 campaign to replace Mayor Adrian M. Fenty (D). The “shadow campaign” subverted legal limits and reporting requirements for political donations.

At the time of his March 2014 plea, Thompson said in court that Gray had worked with him and requested a specific budget for the illegal fundraising scheme that helped put Gray into office — allegations that Gray has called “lies.”

Under Machen, the office made a deal with Thompson that would have him serve no more than six months in prison — rather than as long as seven years — for two felonies. In return, Thompson was supposed to help prosecutors pull back the veil on what Machen called “underground, off-the-books schemes that have corrupted election after election, year after year.”

Gray was not specifically identified in court documents or by Machen. But at the hearing to announce Thompson’s plea deal, U.S. District Judge Colleen Kollar-Kotelly required prosecutors to refer to Gray by name rather than as “mayoral candidate A.”

At a news conference after Thompson’s guilty plea, Machen did not use the former mayor’s name, but he said that anyone else involved in the campaign violations should “come forward and own up.” His comments were interpreted to mean that Gray was the office’s next target.

Machen resigned as U.S. attorney April 1 with the probe into Gray unresolved, saying it would be “a mistake to assume that our office is going to back down on public corruption because I’m leaving.”

When Gray ran for reelection in 2014, he initially appeared to run ahead of the Democratic primary candidates, including Bowser, vying to unseat him. But in the April 1, 2014, primary, Bowser defeated Gray by more than 10,000 votes.

Gray departed the mayor’s office thinking that he would have been reelected had it not been for the investigation, a sentiment shared by many of his most ardent supporters, some of whom hope he returns to politics.

No matter which course Phillips chose to pursue in the investigation, he would have faced legal and political challenges — and criticism. Putting the former mayor on trial would have meant relying heavily on testimony from Thompson. Gray’s attorney, Robert S. Bennett, has made clear that he would have tried to undermine Thompson’s credibility as a government witness by highlighting the favorable terms of his plea agreement.

After Machen’s departure, Vincent H. Cohen Jr., his principal assistant and right-hand man overseeing the probe, served as acting U.S. attorney for six months.

In May, Cohen interviewed for the permanent position with a 12-member panel, and he was asked repeatedly about the status of the Gray investigation and why the probe was taking so long, according to two people who took part in the interview.

Cohen told the committee that he could not get into the details of the probe, according to the two people, because it would be unethical for him to talk about an open investigation.

Del. Eleanor Holmes Norton (D-D.C.), who appointed the committee members, said in a news release that she had recommended Phillips to President Obama as her top choice. In a recent interview, Norton, the District’s nonvoting member of Congress, declined to discuss the process.

The U.S. Attorney’s Office, under Machen, began investigating Gray’s campaign after The Washington Post revealed in early 2011 that a rival candidate, Sulaimon Brown, had been secretly paid by Gray associates to remain in the race and undercut the incumbent, Fenty, to boost Gray’s chances in the Democratic primary.

Mike DeBonis contributed to this report.