Democrats on Wednesday made a last-minute candidate switch in the special election for the Ninth District Assembly seat, choosing Christine Pellegrino, a local teacher and leader in the Opt Out movement that opposes Common Core testing in public schools.

But Suffolk Democratic chairman Richard Schaffer said he would take no part in the nomination or the campaign because of a probe of State Senate Democrats’ fundraising practices. Local political sources say Schaffer is a witness in a probe into an alleged attempt in 2014 by the teachers’ union to make a backdoor $100,000 donation to a senate candidate.

Pellegrino emerged as the candidate Ninth District after she and Ben Lavender, a CSEA Local 1000 organizer, were interviewed by the Working Families Party Monday night. The minor party urged Democrats to make a switch and Lavender declined the nomination, which already was filed in Albany.

Republicans on Tuesday named Conservative Tom Gargiulo, a retired BOCES teacher and Wyandanch girls’ basketball coach, to run in the May 23 special election.

The winner will take the Assembly seat left vacant when Republican Joseph Saladino became Oyster Bay Town supervisor.

Frank Tinari, Suffolk Conservative chairman, said Gargiulo better reflects the values of the district than Pellegrino. “He’s got so many positive qualities, we want to elect him as the only Conservative in the State Legislature,” Tinari said.

Pellegrino, 47, a West Islip resident who has taught reading in Baldwin for 25 years, is a party committee member who was a Bernie Sanders delegate at the Democratic National Convention.

Sign up to receive The 1600 Get our inside look at the White House and goings on in the Donald Trump administration. By clicking Sign up, you agree to our privacy policy.

“She is a candidate with a story to tell that is extremely compelling,” said Lisa Tyson, director of the Long Island Progressive Coalition.

Tyson said that despite the district’s GOP tilt, she expects Pellegrino to gain widespread community support because of her heavy involvement with the school testing issue.

The district has 39,443 registered Republicans, 27,673 Democrats, 1,854 Conservatives and 25,895 voters not aligned with any party, records show.

“I’m like a lot of women who want to roll up their sleeves and make things better for kids,” said Pellegrino. “People are crying out for change and are anxious to do something and get involved.”

Schaffer, part of the three-member committee to fill vacancies, will not take part in the vote to name Pellegrino as the Democratic candidate. “Unfortunately, I will not be able to participate in this campaign in light of an open investigation into the senate Democrats 2014 campaigns,” he said.

Local political sources say Schaffer was called as a witness by Manhattan District Attorney Cyrus Vance over New York United Teachers unsuccessful attempt to steer $100,000 to the campaign of Adrienne Esposito, who ran unsuccessfully in the Third Senate District in 2014, through the county and several town Democratic committees. Schaffer said the contribution violated state law and returned the checks.

It is part of a larger probe over allegations that New York City Mayor Bill de Blasio funneled large donations through several county Democratic committees to help upstate State Senate contenders.

Pellegrino said she has “a lot of respect” for Schaffer and that his stand on the vacancy process has no connection to her candidacy.