ALBANY — A bitter Gov. Paterson is blaming Assembly Speaker Sheldon Silver for his political demise, angrily contending that “despite all I did for him,” Silver conspired to oust him from office.

Paterson is also accusing the powerful Silver of seeking to force his resignation so the speaker’s longtime friend, Lt. Gov. Richard Ravitch, would replace him, sources have told The Post.

“David truly believes he gave Shelly all these big favors, including appointing Ravitch and naming the new chief judge, and that Silver turned on him anyway,” said a source close to Silver.

“He’s saying ‘despite all I did for him,’ Shelly turned against him.”

Paterson defied legal precedent and appointed Ravitch as his lieutenant governor at Silver’s urging last July.

A lawsuit followed, and while Paterson’s actions were declared illegal by a state Supreme Court justice and a unanimous Appellate Division, it was approved by the state’s highest court on a 4-3 vote.

The deciding vote was cast by Chief Judge Jonathan Lippman, Silver’s childhood friend who was named to the high court by Paterson at Silver’s urging a few months earlier.

Paterson told associates that Silver began seeking his ouster months ago, well before last week’s bombshell allegation that he and his staff sought to block a Bronx woman from seeking an order of protection against David Johnson, the governor’s longtime aide.

The associates said Paterson believes Silver turned against him last fall after concluding that the governor would campaign against the Legislature as part of his own election strategy.

Silver himself rejected Paterson’s claims. But he pointedly suggested that the governor’s decision Friday not to run for office resulted from political missteps that predated the latest scandal.

“I believe a lot of people believed he was going to do it [not run] anyway,” Silver told The Post.

Meanwhile, Silver suggested Paterson may have to resign from office because of Attorney General Andrew Cuomo’s newly begun probe into the conduct of the governor, key aides and the State Police in the Johnson order-of-protection affair.

“I think the governor will make a decision [on resigning] based on what the attorney general’s findings are,” Silver said.