State Health Commissioner Dr. Nirav Shah is stepping down amid criticism over his agency’s failure to conduct regular inspections of abortion clinics and for delays in releasing a long-awaited fracking study.

Word of Shah’s resignation late Wednesday came as the Health Department announced it was scrambling to inspect 25 abortion clinics ”within the coming days” — after The Post reported that it hadn’t visited many of them in more than a decade.

The abortion clinic controversy also became a political hot potato for Gov. Cuomo when GOP gubernatorial candidate Rob Astorino Wednesday accused the Health Department of neglect and called on Shah to resign.

An Albany insider insisted that Shah’s resignation was unrelated to abortion scandal or fracking. Shah landed a job at the well regarded Kaiser Health Foundation.

“This has been in the works for quite awhile,” a source said.

Still, other sources say it’s unusual for a commissioner to resign while his boss is running for re-election.

“It doesn’t look good,” said one political strategist.

The Astorino campaign insisted it had no inside information that Shah was about to step down, and expressed surprise that he did so just hours after demanding his resignation.

On Monday, The Post reported that eight of the 25 abortion clinics subject to state inspections had not been inspected at all since 2000, according to documents the Health Department provided in response to a lawsuit filed by the Chiaroscuro Foundation.

Five others were inspected just once over that period .

In its first statement on the issue Wednesday, the Health Department admitted that it usually inspects abortion clinics when they receive a complaint, rather than conducting regular reviews.

“The State Department of Health vigorously and aggressively investigates any and all allegations of physician misconduct, or complaints against a facility under its direct supervision. This includes 22 complaints since 2005 against the 25 DOH-regulated facilities that provide reproductive health services – all of which will also be subjected to re-inspection within the coming days,” said Health Department spokesman Bill Schwarz.

There are believed to be a total of 225 abortion providers in New York state.

The Republican candidate also rapped Shah for delaying a study requested by Cuomo on the health impact of hydrofracking in New York.

“But isn’t the state health commissioner supposed to be New York’s chief medical officer, not a political foil for Governor Cuomo?” Astorino said.

Meanwhile state legislators were demanding answers on why abortion clinics weren’t being inspected.

“It’s kind of scary. The lack of inspections is really quite frightening,” said Staten Island state Sen. Diane Savino, a Democrat who supports abortion rights.

“These are facilities where women are seeking medical care. We shouldn’t allow these medical facilities to take second fiddle to inspections for tanning salons and restaurants.”

Restaurants are inspected annually, and tanning salons biannually.