NEWARK, N.J. — A former ally to New Jersey Gov. Chris Christie who was the mastermind of the 2013 George Washington Bridge lane-closing scheme will not go to prison after pleading guilty and giving testimony that helped convict two former aides to the Republican governor.

Federal Judge Susan Wigenton in Newark sentenced David Wildstein to three years' probation Wednesday along with 500 hours of community service and a ban on working in government.

He faced 21 to 27 months in prison under a plea agreement, but federal prosecutors had asked for him to only get probation after his testimony helped convict former Christie staffer Bridget Kelly and Wildstein's former supervisor, former Port Authority of New York and New Jersey executive Bill Baroni.

David Wildstein, former director of interstate capital projects for the Port Authority of New York and New Jersey, enters federal court in Newark, New Jersey on Sept. 23, 2016. Peter Foley / Bloomberg via Getty Images file

"All three of us put our faith in a man who neither earned it nor deserved it," Wildstein said in court Wednesday of the three charged and Christie. "I willingly drank the Kool-Aid of a man I'd known since I was 15 years old."

Wildstein's sentencing brings to an end to a sordid saga that has left a cloud over Christie's administration. The scandal contributed to his approval rating falling from around 70 percent to 15 percent.

Christie, who is nearing the end of his two-term stay in the Statehouse, wasn't charged but saw his presidential aspirations run aground by a scandal that dragged on for more than three years because of the scheme Wildstein launched to punish a Democratic mayor who wouldn't endorse Christie's 2013 re-election.

Wildstein apologized to Fort Lee Mayor Mark Sokolich and told the judge he regrets what he described as "a callous decision that served no purpose than to punish one mayor. It was stupid, it was wrong."

Kelly and Baroni were sentenced to 18 and 24 months in prison, respectively, in March. Both have appealed their convictions.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: Ex-Christie Allies Bill Baroni and Bridget Kelly Get Prison

Prosecutors told the judge there likely would have been no prosecutions in the case if Wildstein didn't cooperate. Both assistant U.S. Attorney Lee Cortes and Wildstein's attorney, Alan Zegas, asked the judge not to send him to prison.

"He walked into the U.S. attorney's office and said, 'I did this, this is why and this is who I did it with,'" Cortes told Wigenton.

Cortes said "there's no excusing the conduct of David Wildstein. His efforts propelled it forward, he came up with the cover story" and his actions were a "gross abuse." But he noted Wildstein did not delete emails like Kelly and turned over "smoking gun emails and text messages."

He said Wildstein then told the truth during eight days of testimony and spoke with "remarkable candor" about incidents that were personally embarrassing to him.

Zegas said Wildstein provided more information than any other client he's had in 30 years of practicing law and that he was "vilified in the press, vilified in this very courthouse almost daily," partly because of information he provided.

Wigenton told Wildstein he was entitled to a downward departure from the sentencing guidelines because he provided truthful information, including context to the emails that Kelly had deleted and cooperation that led to a separate bribery charge against another Christie ally, former Port Authority Chairman David Samson.

Related: Former Christie Aide Pleads Guilty in United Airlines Bribery Case

Samson was sentenced to probation and home confinement earlier this year after admitting he used his position to pressure United Airlines to revive a flight from Newark Liberty International Airport to South Carolina, near his weekend home.

Samson is a former New Jersey attorney general and longtime mentor to Christie, who appointed him to head the powerful Port Authority in 2011.

Wildstein and Christie went to Livingston High School together in suburban Newark. Christie played catcher and dreamed of playing for the New York Mets but went on to become a federal prosecutor and governor. Less athletically inclined, Wildstein was the baseball team's statistician who became a behind-the-scenes political player with a bagful of dirty tricks he was unafraid to use.

Years later their paths came full circle in the saga known as "Bridgegate," the bizarre tale of traffic-jams-as-political-payback that took aback even hardened observers of New Jersey's bare-knuckle political arena.

Wildstein was a political blogger and operative who admitted engaging in chicanery that included stealing the suit jacket of an opposition candidate right before a U.S. Senate campaign debate. Christie, who claimed the two weren't friends in high school, approved hiring him to a position at the Port Authority ostensibly overseeing billions of dollars in infrastructure projects in the New York area.

While defense attorneys and some Port Authority officials characterized Wildstein as lacking in relevant experience for the job — and being universally disliked for his abrasive style — a court filing by Wildstein's attorney described him as having business savvy that helped him in "peeling back red tape" so that major agency infrastructure projects could be realized.

Wildstein and both defendants contradicted Christie's account that he didn't know about the traffic jams or their purpose until months afterward. Wildstein testified he and Baroni joked with Christie about traffic problems in Fort Lee while the lane closures were underway, and Kelly testified she told the governor about the plans to close lanes before they occurred.

Former Major League Baseball player Charlie Hayes wrote in a letter to the judge that Wildstein can perform the community service for a nonprofit foundation Hayes has asked him to run. Wildstein also is collaborating on a book with former Yankee pitcher Fritz Peterson.