Gov. Gavin Newsom signed a law Thursday overhauling California’s charter schools in a move that brought together teachers’ unions and charter school advocates who have long been at odds over how the schools affect public education.

Charter schools are public schools, but they operate by different rules than traditional public schools. Anyone can apply to create a charter school, and state law had required school districts to approve them if they met certain basic requirements.

That has led to an explosion in charter school growth, with enrollment more than doubling in California over the last decade. The state now has more than 1,300 charter schools that serve about 10% of the state’s more than 6.2 million public school students, according to the California Department of Education.

Critics, including teachers’ unions, have long blamed the proliferation of charter schools for placing financial stress on traditional public schools. But supporters have said the schools are a needed alternative for students seeking more than what traditional schools offer.

The law Newsom signed on Thursday is a compromise, giving school districts more authority to choose which charter schools are approved. For example, it would let districts deny charter school applications if the district is struggling financially, as determined by the county superintendent of schools.

It also allows lets charter school applicants appeal districts’ decisions to the county boards of education and, in some cases, the state board of education.

“To give districts that are facing serious financial challenges the opportunity to evaluate what is the impact of any new school, that’s groundbreaking and significant,” said Tony Thurmond, the state Superintendent of Public Instruction.

The law requires school districts to shut down charter schools that do not meet performance standards, either academic or financial. And it requires all teachers at charter schools to have the same credentials as teachers in traditional public schools.

More than 60% of the state’s charter schools are in Los Angeles County, San Diego County and the nine counties in the Bay Area near San Francisco.

A legislative analysis of the bill that led to the charter school law said that most charter school growth has been in areas where students come from low-income families.

Newsom, a Democrat, said it was difficult to pass the legislation and that “there were moments when we honestly thought this thing was dead.”

He said it was impressive that the presidents of California’s largest teachers’ union and the California Charter Schools Association were stood next to each other as he signed the law.

“This is the most comprehensive reform in close to 30 years,” Newsom said.

Myrna Castrejón, president and CEO of the California Charter Schools Association, said the law is important because it “affirms that high quality charter schools are here to stay.”

E. Toby Boyd, a kindergarten teacher and president of the California Teachers Association union that represents educators, said there is more work to do and “we are not shying away from that.”

“But today is to celebrate what just occurred. It’s changing a law that has been in place for a long time,” he said, standing next to Castrejón. “It’s for the betterment of our students, and both of us can agree to that.”