Firing a warning shot at the state’s corruption-mired capital, a Manhattan federal judge Thursday ordered Gov. Cuomo’s former top aide and confidante to serve six years in prison for bribery.

“I hope this sentence will be heard in Albany,” Judge Valerie Caproni told a packed lower Manhattan courtroom at ex-Cuomo right-hand Joseph Percoco’s sentencing.

“If you can’t live on a public sector salary, get out of government.” intoned Caproni, clearly not just speaking to Percoco. “What you can’t do is stay in government and make up the difference in income by taking bribes. If you do, this court will show you no mercy.”

Percoco, who was once so close to the governor he was likened to a brother, sat stone-faced as the judge delivered the blow.

“He spoke for the governor, whether Andrew Cuomo knew what he was doing at any given point in time or not,” the judge said of Percoco.

Percoco, 49, was convicted in March of accepting more than $300,000 from companies that wanted to gain influence with the Cuomo administration.

His lawyers had asked for just two years behind bars, saying Percoco deserved a break because he was not an elected official and wasn’t all that influential with the governor.

But prosecutors blasted that notion, saying Percoco was “perpetually in the ear” of one of the “three men in a room” making decisions in Albany, including former Assembly Speaker Sheldon Silver, ex-Senate Majority Leader Dean Skelos — both of who have been convicted of corruption — and Cuomo.

“He was one of his closest advisors. He spoke for the governor,“ prosecutor Janis Echenberg said.

And he used his power, Echenberg said, to line his own pockets with $320,000 in bribes from two companies doing business with the state.

At trial, prosecutors showed that he even referred to his bribes as “ziti” a term he lifted from HBO’s mob show “The Sopranos.”

“Where the hell is the ziti?” “I have no ziti,” he wrote in emails to his co-conspirator, the corrupt Albany lobbyist Todd Howe.

“Joe watched the show,” Howe, the government’s star witness, told jurors at trial.

Percoco was ordered to turn himself in on Dec. 28.

His lawyers have asked that he serve his time at the Federal Correctional Institution in upstate Otisville, Orange County — where money manager to the stars Kenneth Starr served a 7-year stint.

Fortunately for him, the Federal Bureau of Prisons menu online offers baked ziti and ziti with beef on some nights.

His lawyer said he is seeking bail pending appeal, which could keep him free longer if the request is approved by the judge.

“Joe is a good man,” his lawyer Barry Bohrer told the judge. “He went off the rails in a couple of instances.”

But the judge disagreed, saying the evidence at trial shows he flouted the rules in even little ways, including using “his state office and swipe card” after he had left his job to work on Cuomo’s reelection campaign.

“When the executive deputy secretary flouts the most basic rules of campaign finance and government record keeping it’s no wonder that that many other state employees follow his lead to the detriment of rule of law and transparency in government,” Caproni said.

And the judge drew a parallel to her recent sentencing of Silver, 74, who begins serving a seven-year sentence next month after his conviction in a $4 million corruption case.

Caproni said she showed Silver a bit more mercy due to his advanced age and poor health, but had no reason to do so for Percoco, who she also blasted him for acting as a personal goon to an executive of a development company that gave him $35,000.

At trial, the government showed that Percoco helped to boost the salary of Cor Development executive Steven Aiello’s son, who worked in the Executive Chamber of the Governor’s Office, and also boot a low-level employee from Cuomo’s floor at Aiello’s request because the Aiello’s son didn’t like him.

“That, Mr. Percoco, is not leadership. It’s not setting a good example it’s being a bully,” the judge said.

In a second scheme, Percoco was found to have used his influence to secure a $7,500-a-month, “low-show” job for his wife Lisa with power company Competitive Power Ventures.

Lisa was not in the courtroom for the sentencing.

“This case reached to the highest levels of the executive branch,” the judge said at one point. “Frankly, it’s not surprising that the citizenry of this state have lost their faith in government,” she said.

Indeed, the Empire State has also suffered four corruption convictions this year at the hands of Manhattan federal prosecutors, including the corruption retrials of Silver and Skelos. Also convicted at trial was Alain Kaloyeros, a scientist Cuomo tapped to help run his upstate economic development program “Buffalo Billion.”

“Joe Percoco is paying the price for violating the public trust. And it should serve as a warning to anyone who fails to uphold his or her oath as a public servant,” Cuomo said in a statement.

Percoco also spoke at sentencing, saying he is sorry for his actions. But the remarks echoed a letter he recently submitted to the judge, which she said weren’t convincing.

“It’s not entirely clear to me what he’s remorseful for,” Judge Caproni said about Percoco’s letter earlier in the hearing. “Is he remorseful for getting caught?” she asked.

“I would just like to express how sorry I am for my actions,” Percoco told the judge. “I live with the consequences every night and day of my life. I will continue to live with the consequences of those actions for the rest of my life.”