Jeffrey E. Thompson leaves the William B. Bryant Annex at the U.S. Courthouse on Monday following a sentencing hearing in Washington. (Nikki Kahn/The Washington Post)

Jeffrey E. Thompson, the political donor behind the illegal financing of Vincent C. Gray’s 2010 mayoral bid, was sentenced to three months behind bars after a federal judge on Monday rejected arguments from prosecutors who sought only home confinement for the former District government contractor.

Those prosecutors cited Thompson’s “extraordinary cooperation” in the long-running investigation that uncovered $2.5 million in illegal spending on local and federal campaigns, and attorneys for Thompson, 61, had noted that the once-prominent city contractor “never wavered in his candor” and suffered professionally and personally because of the investigation.

But U.S. District Judge Colleen Kollar-Kotelly said six months of home confinement was “not sufficient” punishment for a 12-year stretch of campaign finance offenses punctuated by a last-ditch effort to obstruct federal investigators by shredding documents, creating false invoices and instructing a key accomplice to leave the country.

“He was the leader, organizer, and mastermind of this conspiracy,” she said, adding that she wanted potential offenders to “think very carefully” before engaging in similar offenses.

The judge also ordered that Thompson serve 36 months probation and pay a $10,000 fine. He was released Monday and will report to serve his sentence at a later date.

Jeffrey E. Thompson leaves the William B. Bryant Annex at the U.S. Courthouse on Monday following a sentencing hearing in Washington. (Nikki Kahn/The Washington Post)

In court, Thompson apologized to his family, friends and the community. “My parents always taught me at an early age to tell the truth, no matter the consequences,” he said. “One can only accept responsibility with a clear conscience.”

Thompson declined to comment after the sentence was imposed.

His sentencing Monday helps bring to a close a nearly five-year investigation that began with reports of financial misconduct within Gray’s successful 2010 mayoral campaign. A half-dozen people directly related to that campaign have since pleaded guilty to federal charges.

The probe also revealed illegal spending by Thompson on the 2006 D.C. mayoral race and a host of D.C. Council races, as well as several congressional campaigns and Hillary Clinton’s 2008 presidential bid.

In some cases, he funneled money from his companies through friends and relatives who acted as “straw donors” and gave donations directly to candidates. In other cases, he funded parallel “shadow campaigns” that undertook voter registration drives or get-out-the-vote efforts but did not report their spending to campaign finance authorities as required.

When Thompson’s cooperation became public in March 2014, prosecutors expected him to help them prove that Gray knew about the 2010 shadow campaign. Thompson and his associate Jeanne Clarke Harris told investigators that Gray personally asked Thompson for the $653,000 in off-the-books funding, according to court records.

In December 2015, the District’s newly appointed U.S. attorney, Channing D. Phillips, shut down the investigation without charging Gray, saying there was likely insufficient evidence to bring criminal charges against anyone else.

Gray has vigorously denied any knowledge of the illegal spending. He has launched a successful political comeback: The former mayor is poised to rejoin the D.C. Council after winning the Democratic primary for the Ward 7 seat in June. He declined to comment Monday through a spokesman.

Gray’s allies and other D.C. political observers have cast doubt on the decision by Phillips’s predecessor as U.S. attorney, Ronald C. Machen Jr., to cut a plea deal with Thompson — who admitted to engaging in corrupt political dealings dating back to 2000 — in an apparent bid to prosecute a sitting mayor.

D.C. Council member Mary M. Cheh (D-Ward 3), a professor of criminal law at George Washington University, said Monday the investigation has been largely positive in revealing corruption. But she said prosecutors had made “entirely too cozy a deal” with Thompson while allowing relatively minor figures to suffer more serious consequences.

“His corruption and criminality was so pervasive and so corrosive of politics here that the very fact that he was rooted out was of great benefit to the city,” Cheh said of Thompson. But “the prosecution should have been proportionate to the criminality that was discovered ... It certainly merited more given the extensiveness of his corruption.”

Prosecutor Michael Atkinson argued in court Monday that Thompson did a significant public service by admitting his own schemes and exposing a broader “culture of crooked elections” in the District.

“We decided we could not bring the shadow campaign into the light of day without Mr. Thompson’s acceptance of responsibility and his complete cooperation,” Atkinson said. “Mr. Thompson has held up his end of the bargain.”

Thompson did so in a “no-nonsense” manner, he added, meeting with prosecutors on 17 occasions in what were often day-long debriefing sessions.

Neither Atkinson nor Thompson’s attorney dwelled on the reasons Thompson never did appear on a witness stand.

In a court filing last month, prosecutors said for the first time that they could not rely on Thompson as a witness in a potential case against Gray because of other evidence they uncovered about Thompson. The information, prosecutors said, could have been used to weaken Thompson’s credibility on the witness stand.

The Washington Post revealed that the broader campaign finance probe was stalled for months as investigators questioned witnesses about the ages of Thompson’s sexual partners to determine whether he had committed a crime.

The U.S. attorney’s office said in its July filing that investigators were not able to corroborate the “most serious allegations” about Thompson and decided not to bring additional criminal charges against him.

Had Thompson not cooperated and gone to trial, he could have faced seven years in prison.

The favorable terms of the plea deal for the man behind the shadow campaign have been a source of controversy. Other defendants connected to the conspiracy have objected to what they called uneven punishment for lower-level participants.

Vernon Hawkins, a longtime political adviser to Gray who helped design the Thompson-funded off-the-books campaign, was sentenced to six months in prison in May. Thomas Gore, a top campaign aide to Gray, also was sentenced to six months for campaign finance violations and a felony obstruction of justice charge.

Kollar-Kotelly was the sentencing judge for Hawkins and Gore, and she is set to preside over the sentencing hearing for Harris later in September.

Both the prosecution and defense lawyers traced Thompson’s rise from poverty in rural Jamaica to his work as a self-made businessman who would build one of the nation’s largest minority-owned accounting firms and a health-care company that won a $300 million-a-year contract to manage health care for poor D.C. residents.

Those businesses both rose or fell based on Thompson’s relationships with government officials; Kollar-Kotelly concluded that his motive to engage in rampant political corruption was “overwhelmingly one of self-interest.”

Atkinson described Thompson as a kind of criminal entrepreneur who took an existing culture of corruption and “made it bigger and more pervasive.” He recounted how he explained his practice of donating to politicians he despised by quoting from “The Godfather”: “Keep your friends close and your enemies closer.”

Thompson’s reputation and his business portfolio are now in shambles. A pre-sentencing report cited in court found that Thompson is now heavily in debt, his $3 million in assets outweighed by some $4 million in liabilities. But the judge also said Thompson has “income coming in” and determined he would be able to pay a fine.

Atkinson argued the public spectacle of Thompson’s downfall did more than any prison sentence would to deter future political wrongdoers.

“If the District’s culture of crooked elections has finally come to a close, Mr. Thompson may have helped more people through his downfall than he did through his rise,” Atkinson said.