Sheldon Silver came under pressure from some Democrats as well as Republicans Thursday to give up his post as Assembly speaker after getting snared on federal corruption charges.

But Silver also had his defenders — none more fervent than Mayor Bill de Blasio, who described his Albany ally as “a man of integrity” on the day he was charged with taking bribes of nearly $4 million.

“Although the charges announced today certainly are very serious, I want to note that I’ve always known Shelly Silver to be a man of integrity, and he certainly has due-process rights, and I think it’s important that we let the judicial process play out,” the mayor said at City Hall.

Other Democrats were anxious to move on, saying Silver couldn’t possibly remain in place.

“Speaker Silver should resign for the good of the people of New York,” tweeted state Sen. Brad Hoylman (D-Manhattan).

“Another shameful day in Albany. When we should be discussing State of the State, we are mired in state of corruption. Public deserves better.”

Zephyr Teachout, the liberal Fordham University professor who challenged Gov. Cuomo’s re-election bid last year, said it’s high time for Silver to go.

“The allegations against him represent a massive breach of the public trust and impair his ability to claim a leadership role in New York state,” said Teachout, who wrote a book called “Corruption in America.”

One Democratic Assembly member told The Post privately what he couldn’t say publicly: that Silver would become a “distraction” if he tried to stay in power.

“The right thing to do is, in this case, he should step down. I’m not saying as an Assembly member, but the leader should not be a distraction,” the legislator said.

“There are a lot of important negotiations that are going to be taking place.”

Republicans — who have often been frustrated during Silver’s 20-year reign — said the Teflon has come off.

“It is imperative Sheldon Silver resign immediately as speaker of the Assembly . . . We cannot afford this distraction with the important business before the Assembly and the people of New York state,” said Assembly Republican Minority Leader Brian Kolb.

Assemblywoman Nicole Malliotakis (R-SI) agreed.

“The demands of running the chamber and serving the taxpayers cannot be compromised by charges of corruption and a judicial proceeding of this magnitude. There is no doubt that New Yorkers desperately need and deserve new leadership of ‘the People’s House,’ ”she said.

Most Democratic allies stood behind Silver — for now.

“All I can say is the speaker has the full support of the conference,” said Assemblyman David Weprin (D-Queens).

Before the corruption bombshell hit, Democrats were awaiting Silver’s appointments to committee chairmanships and other key leadership posts.

Some junior members seeking to move up don’t want to jeopardize their chances by criticizing the speaker, insider said.