SACRAMENTO — The state sued the Orange County city of Huntington Beach on Friday to force it to plan for more affordable housing, part of a campaign by Gov. Gavin Newsom to boost construction in California as residents grapple with soaring housing costs.

Newsom said Huntington Beach has refused to meet a state mandate to provide new housing for low-income people. He promised that cities that do not do their part will be “held to account.”

“The time for empty promises has come to an end,” state Attorney General Xavier Becerra wrote in the complaint, which was filed in Orange County Superior Court. California is seeking an order that would compel Huntington Beach to set aside additional sites for low-income housing.

The lawsuit was the first to be filed under a 2017 law, AB72, that authorized state housing officials to report cities and counties to the attorney general for legal action if they do not adequately plan for housing construction.

The action sends a stark message to communities like Huntington Beach that have not followed a state requirement to adopt a blueprint every five to eight years demonstrating how they will plan for regional housing needs for people across all income levels.

More than four dozen California localities do not have state approval for their housing blueprints, according to the California Department of Housing and Community Development. They range from rural Lake County to wealthy beach communities like Encinitas in San Diego County. None is in the Bay Area.

Huntington Beach, a city of about 200,000, must build 533 low-income housing units by the end of 2021 to meet its state quota.

But it faces a shortfall of more than 400 units after the City Council, under intense opposition from residents, scaled back zoning approval for high-density development in 2015.

Huntington Beach City Attorney Michael Gates, in a statement, disputed the accuracy of the state’s legal argument. He said the city has been working with California officials to meet regional housing needs and that the lawsuit would cut off those discussions.

“It is noteworthy that Sacramento is suing only the city of Huntington Beach, while over 50 other cities in California have not yet met” their targets, Gates said. “That raises questions about the motivation for this lawsuit filed only against Huntington Beach.”

The legal fight advances an aggressive housing agenda that Newsom has set in the first weeks of his administration. On the campaign trail last year, he talked about building 3.5 million housing units by 2025 to meet projected population growth, a figure put forward by the building industry that would require California to quintuple its current rate of construction.

In his budget proposal this month, Newsom called for setting aside $1 billion to expand state loan and tax credit programs for housing development and another $500 million to encourage cities and counties to hit their production goals. He also suggested tying those targets to transportation funding, threatening to block grants for roads and public transit to local governments that do not meet housing goals.

Newsom, in a statement, called the shortage of affordable housing in California “an existential threat to our state’s future” that “demands an urgent and comprehensive response.”

“But some cities are refusing to do their part to address this crisis and willfully stand in violation of California law. Those cities will be held to account,” he said.

Newsom authorized a lawsuit against Huntington Beach because the city scrapped plans that would have allowed it to meet its affordable housing target.

In March 2016, Huntington Beach leaders rejected a proposal that would have brought the city in line with its target. Since then, the city has “taken no action to bring the housing element into compliance,” the state Department of Housing and Community Development said in November.

Huntington Beach’s median family income in 2017 was $88,000, about $20,000 higher than the statewide figure, census data show. Just under 9 percent of its residents were living below the poverty level.

The resistance in Huntington Beach was an impetus for AB72, said Anya Lawler, a policy advocate for the Western Center on Law & Poverty. Her organization was one of the sponsors of the law.

Marina Wiant, vice president of government affairs for the California Housing Consortium, another sponsor of AB72, said the lawsuit could mark a turning point after years of lackluster enforcement of regional housing goals and send a signal to other “egregious offenders.”

The state may file more such lawsuits in the coming months. A spokesman for the governor said to “stay tuned.”

Alexei Koseff is a San Francisco Chronicle staff writer. Email: alexei.koseff@sfchronicle.com Twitter: @akoseff