Gov. Andrew Cuomo’s former top aide Joseph Percoco was convicted Tuesday on three corruption charges — but cleared of three others in a surprise, mixed verdict.

Percoco, 48, was found guilty on two counts of conspiracy to commit honest-services fraud in a pair of “pay-to-play” scams that the feds say netted him more than $300,000 from execs at two companies doing business with the state.

But while Percoco was convicted of soliciting bribes from the Competitive Power Ventures energy company, he was acquitted of a similar charge involving the Syracuse-based COR Development Co.

He also was acquitted of two extortion raps in both schemes.

Percoco faces 50 years in prison at his sentencing, which was set for June 11.

The verdict followed a roller-coaster, seven-week trial that saw the prosecution’s star witness — ex-lobbyist and former Percoco pal Todd Howe — get busted by the feds midway through his testimony.

Howe was locked up after admitting during cross-examination that he tried to scam his way out of paying for a stay at the Waldorf Astoria hotel while he was negotiating his guilty plea and cooperation deal with the feds.

In a prepared statement, interim Manhattan US Attorney Geoffrey Berman said, “Joseph Percoco was found guilty of taking over $300,000 in cash bribes by selling something priceless that was not his to sell — the sacred obligation to honestly and faithfully serve the citizens of New York.

“As every schoolchild knows, but he corruptly chose to disregard, government officials who sell their influence to select insiders violate the basic tenets of a democracy,” Berman added.

“We will continue relentlessly to bring to justice those public officials who violate their oaths by engaging in this especially offensive misconduct.”

In addition to the verdict against Percoco, the jury convicted COR president Steven Aiello of conspiracy to commit honest-services fraud but acquitted him of paying bribes and lying to the feds.

Aiello faces up to 20 years in prison at his June 14 sentencing.

Another COR exec, general counsel Joseph Gerardi, was acquitted on three similar charges, but both he and Aiello still face another corruption trial involving Cuomo’s signature “Buffalo Billion” revitalization project.

The jury deadlocked over conspiracy and bribery charges against former CPV exec Peter Galbraith Kelly Jr.

The developments came midway through the eighth day of deliberations in Manhattan federal court, and a little more than 90 minutes after the jury asked if it could decide some counts but not others against Percoco and his three co-defendants.

The panel had twice previously said it was deadlocked, with the first indication coming in a March 6 note that said: “The only thing we seem to agree on is that we cannot agree.”

Manhattan federal Judge Valerie Caproni told the jury, “Yes, you can return a verdict on some counts, but not all.”

“I have never experienced this chronology,” she told lawyers on both sides before delivering the instruction.

The Reinvent Albany reform group said Percoco’s conviction “confirms again that New York State has a pernicious problem with pay to play and unethical behavior.”

“But the real headline here is that in New York, state laws are so weak that what is unethical is often legal. … Under state law, you can legally donate unlimited amounts of money to the Governor and Legislature, while trying to cash in on a giant state contract or get state funding,” the group said.