A longstanding threat to charter school growth could become more pressing this year now that progressive Democrats are poised to claim more seats in New York’s State Senate.

More than half a dozen incumbent senators who have supported charter schools lost their primary challenges Thursday, leaving charter advocates without key allies in Albany at a time when lawmakers will have to act if many more of the publicly funded, privately managed schools are to open.

If Republicans retain control of the senate in November’s general election, the shift might not matter much: Democratic critics of charter schools won’t have the power to control legislation affecting the sector.

But if, as many observers consider probable, Democrats take control of the chamber, the ascendance of progressive candidates could spell trouble for efforts to lift limits on charter schools, known as the charter cap. While the Democratic senators who were defeated on Thursday largely backed lifting the cap, their replacements are unlikely to do so.

Right now, 28 more charter schools can get permission to open in New York City, according to the New York City Charter School Center, and those approvals are likely to happen by early 2019. If lawmakers don’t lift the cap in their next legislative session, no new charter schools will be able to get permission to open in the city unless other schools are closed. (The law allows for more schools to open in other parts of the state.)

Charter advocates were optimistic that the current legislature would raise the cap. Now, they’re concerned that next year’s lawmakers might instead grind the sector’s rapid expansion to a halt.

“Charter schools are clearly working, students are learning, parents want their kids in them,” said James Merriman, the charter center’s CEO. “We — the center and the sector — are not going to change our message or our push to eliminate the cap.”

Six of the Democratic incumbents unseated on Thursday were part of the now-defunct Independent Democratic Conference, a breakaway group that voted with Republicans on many issues, including those related to charter schools.

And many of them had received major donations from charter school supporters, including hedge fund executives Daniel Loeb and Paul Singer and the advocacy group StudentsFirstNY.

The lawmaker who led the breakaway group, Jeffrey Klein of the Bronx and Westchester County, appeared at charter school rallies and was considered a reliable counterweight to fellow Democrats who are critical of charter schools. He lost to Alessandra Biaggi, a former aide to Gov. Andrew Cuomo whose platform includes a vow to “stop siphoning money to privately run charter schools.”

Jose Peralta of Queens and Martin Dilan of Brooklyn (who had not voted with Republicans) got donations this year from StudentsFirstNY, a charter advocacy group.

Dilan was defeated by Julia Salazar, whose platform explicitly includes “maintaining the charter cap, making sure our school system remains publicly governed and controlled by all of us.”

Peralta’s challenger, Jessica Ramos, does not mention charter schools in her official platform, but she said she opposes them during a debate with Peralta, according to a Queens newspaper.

StudentsFirstNY Executive Director Jenny Sedlis said in a statement that the group would keep pushing its agenda with the newest crop of lawmakers.

“It’s clear that voters are passionate and engaged, and we are working to mobilize that energy to improve public schools and expand opportunity to more kids,” she said in a statement. “We look forward to working with electeds on all ends of the political spectrum to benefit children.”

But gaining any traction with the latest crop of state senators is likely to be a challenge for the group. Other winners of the competitive races have opposed charter school growth in New York City in the past.

John Liu, the former city comptroller, will be the Democratic nominee in the Queens district that Tony Avella has represented since 2010. As a mayoral candidate in 2013, Liu said he would charge rent to charter schools in city space — at the time considered a potentially crippling threat to the sector.

And then-City Council education chair Robert Jackson, who beat Marisol Alcantara in the senate district that includes Harlem, in 2011 sued the city to stop charter schools from opening in district buildings.

The primary winners in the State Senate are considered likely to win in November’s general election because they come from districts that have recently elected Democrats. That leaves charter advocates relieved that Cuomo, a longtime charter supporter with significant power under the state’s lawmaking process, easily fended off a challenge from actress and education advocate Cynthia Nixon — but also in limbo as they await a potential reorganization of power in Albany.

“I hope this transcends politics and who’s in and who’s out,” Merriman said. “But we’re going to have to see.”