California’s top cop is siding with housing advocacy groups in a Bay Area lawsuit that could have major implications in the battle for control over where and how new homes are built.

Attorney General Xavier Becerra on Tuesday announced that he, along with Gov. Gavin Newsom, had filed to intervene in a dispute over a San Mateo condominium proposal to defend a statewide housing law.

A couple of years ago, the Peninsula suburb’s city council rejected a proposal for a 10-unit development at W. Santa Inez Avenue and busy El Camino Real. The council said the condo proposal violated the city’s design guidelines aimed at limiting height differences among nearby properties.

But housing advocates have argued that a longstanding state law, known as the Housing Accountability Act, should supersede the city’s decision given California’s housing crisis. That law limits when cities can reject proposals that comply with local zoning laws. And, they worry, if the initial ruling in San Mateo’s favor stands, the case could give opponents of multi-family housing ammunition to fight other legislation aimed at increasing housing production across the state.

“We’re concerned that the reasoning from this decision could be used to undermine efforts like SB 50,” said Dylan Casey, the executive director of the California Legal Advocacy and Education Fund, (CaRLA) a lead plaintiff in the case, referencing a controversial proposal from state Sen. Scott Wiener that would force cities to allow denser housing development.

Casey said his organization was pleased to hear about Becerra intervening, meaning the attorney general’s team will have the ability to argue the case like a co-plaintiff.

“I think it’s important to defend the ability of the state legislature to legislate housing issues,” Casey said.

CaRLA filed a notice stating that it planned to appeal the ruling in San Mateo’s favor several days ago, but it could take months to get a hearing.

“This is a singular case in which the developer of a 10-unit market-rate project did not meet the city’s objective standards, and the judge agreed we complied with the Housing Accountability Act in denying the project on that basis,” said Shawn Mason, city attorney for San Mateo. “We understand and respect the Attorney General’s decision to intervene regarding the constitutionality of the Housing Accountability Act, and we look forward to having our independent court system review this case.”

It’s not the first time Becerra has waded into housing cases. Last year, he joined Oakland in a suit against Wells Fargo accusing the company of pushing minority borrowers toward riskier loans than white customers. And he joined other states in pushing back against a Trump administration proposal to deny transgender people access to shelters that get federal funding.

“The state has a fundamental interest in helping Californians access affordable housing,” Becerra said in a statement. “We all have to work together to take on this challenge and that starts with having the units we need to meet demand. This is about upholding our state’s laws and doing our part to ensure that all Californians have a place to live.”

Mason said San Mateo recognizes that a lack of affordable housing is a critical issue and that the city has crafted policies and set aside funding to help build it.

“San Mateo created hundreds of affordable homes with the support of former redevelopment agency funds, and when the state dissolved that resource, the City Council committed local tax dollars to fund affordable housing,” Mason said.

State figures suggest California needs to add an average of 180,000 homes a year to keep up with housing demand, but has been averaging less than 80,000. Newsom said in a statement that he asked Becerra to intervene so the state can rely on the Housing Accountability Act throughout California.

“California will defend our ability to tackle the cost crisis,” Newsom said, “by holding all cities accountable to statewide housing policy.”