Disgraced former Assembly Speaker Sheldon Silver was sentenced to 12 years in prison for corruption on Tuesday in Manhattan federal court, climaxing the dramatic fall of a man who had stood at the pinnacle of political power in New York for two decades.

“I hope the sentence I am going to impose will serve as a general deterrent to others that other politicians will see that corruption is going to be dealt with severely,” said U.S. District Judge Valerie Caproni, who also imposed a $1.75 million fine on the onetime power broker. “I hope that the sentence I’m going to impose on you will make the next politician hesitate just long enough before taking a bribe or a kickback, for his better angels to take over. Or if there are no better angels and for some people, there are not, then maybe his fear of living out his golden years in an orange jumpsuit will put him on the straight and narrow.”

Silver must also forfeit more than $5 million in ill-gotten gains, the judge said.

Mobbed by reporters outside the courthouse, Silver said: “I believe in the justice system and we will pursue all available remedies.” His lawyer said he was disappointed with the sentence and that he will appeal in federal court.

Silver finally reached the corner of Centre Street, where a yellow cab waited for him.

Silver must surrender no later than noon on July 1, the judge said.

Silver, who earlier had asked for leniency, told the judge, “Your honor, I believe that my letter to the court probably captures it best. Without question, I’ve let down my family, I’ve let down my colleagues, I’ve let down my constituents. And I’m truly, truly sorry for that.”

U.S. Attorney Preet Bharara tweeted shortly after the sentence was imposed: “Today’s stiff sentence is a just and fitting end to Sheldon Silver’s long career of corruption.”

Silver, 72, a Democrat who represented Manhattan’s Lower East Side, was convicted in December of doing favors for an asbestos researcher and two real estate companies in return for their help funneling nearly $4 million in law firm referral fees to him.

Prosecutors from the office of Bharara, who made Silver a priority target in his campaign against Albany corruption, wanted Caproni to give the highest federal prison sentence ever for a New York politician — more than 14 years — and a fine of at least $1 million.

Silver, who is in remission from prostate cancer, asked for leniency, with all or most of his sentence imposed through community service outside of prison. Federal sentencing guidelines called for nearly 22 years, and probation officials urged 10 years.

In addition to his conviction for using his public office in return for legal fees, Silver was also damaged after trial when Caproni ordered the release of government filings alleging he engaged in extramarital affairs with a lobbyist and a woman he helped get a state job.

The judge said at the time that even though that evidence wasn’t admitted at trial, it was relevant to her sentencing decision because it reflected other examples of his misuse of public office.

Silver was convicted in December of doing legislative favors for an asbestos researcher and two developers who funneled law firm referral fees to him. Silver and former Senate Majority Leader Dean Skelos, also convicted in December and scheduled to be sentenced next week, are the two biggest targets Bharara has taken down in his clean-up-Albany campaign.

While Bharara’s anti-corruption investigations remain active, with ongoing probes targeting aides to Gov. Andrew M. Cuomo and Mayor Bill de Blasio’s fundraising, Bharara and others have been critical of the lack of legislation in Albany to tighten up ethics laws.

The federal probation office had recommended a 10-year prison sentence, but Bharara’s prosecutors had urged Caproni to exceed the previous high for a New York legislator — 14 years imposed on former Assemb. William Boyland in Brooklyn last year for two separate bribery schemes and submitting phony expense vouchers.

Silver, the government says, had a leadership role in the Assembly unlike Boyland, had an even higher recommended range than Boyland of at least 22 years under federal sentencing guidelines, and like Boyland went to trial instead of pleading guilty.

Prosecutors have also urged the judge to impose a hefty fine of at least $1 million, in addition to forfeiture of all the fruits of the crime, so that his benefits from his $73,000 annual state pension are limited.

In addition to his conviction for using his public office in return for legal fees, Silver was also damaged after trial when Caproni ordered the release of government filings alleging he engaged in extramarital affairs with a lobbyist and a woman he helped get a state job.

Caproni, a former prosecutor and general counsel at the FBI who was named to the federal bench in 2013, said that even though the evidence of affairs hadn’t been admitted at trial, it was relevant to her sentencing decision because it reflected other examples of Silver’s misuse of public office.

Silver’s sentencing submission included dozens of letters of support from such luminaries as former New York City Mayor David Dinkins. It said Silver has arranged with the Fortune Society, a group that aids convicts with re-entry programs, to work as an employment services counselor if Caproni orders community service.

Silver has also revealed that he has prostate cancer, currently in remission.

“It terrifies me that his father and brother both died of the same kind of cancer Shelly was diagnosed with,” his wife of 49 years, Rosa, wrote to the judge. “I am afraid he will be sick and, even worse, alone.”