LOS ANGELES (AP) — An oil company sued the city of Los Angeles Tuesday over its recent law to ban the drilling of new oil and gas wells and to phase out existing ones within city limits over the next two decades.

Warren Resources, which has been producing oil in Los Angeles since 2005, filed the lawsuit seeking to block the city’s ordinance from taking effect. The company said the law will effectively shut down its operations because it’s dedicated to oil and gas extraction solely in the Los Angeles area, where it operates 244 wells and produces about 1,800 barrels of oil per day, according to court papers.

Warren Resources has spent millions to consolidate our operations into a single, all-electric location with an impeccable environmental record,” James A. Watt, Warren’s president, said in a statement. “Shutting down our operations puts the City — and its taxpayers — at huge liability.”

The lawsuit also accused the city of failing to conduct a proper environmental review of the measure.

The Los Angeles City Attorney’s office did not immediately respond to a message seeking comment. 

The Los Angeles City Council voted unanimously for the measure last year following more than a decade of complaints from residents that pollution drifting from wells was affecting their health.

Los Angeles was once a booming oil town. Many of its oilfields are now played out, but it still has several productive ones. According to the city controller’s office, there were 780 active and 287 idle wells in Los Angeles in 2018. An idle well is one that isn’t operating, but hasn’t been permanently sealed, so it could be brought back into production.

Many more wells lie just outside the Los Angeles city limits, in Carson, Inglewood and Long Beach.

Researchers from the University of Southern California in a study in 2021 found that people living near wells in two Los Angeles neighborhoods — University Park and Jefferson Park — reported significantly higher rates of wheezing, eye and nose irritation, sore throat and dizziness than neighbors living farther away. Both of those communities are predominantly non-white with large Black and Latino communities, according to the U.S. Census.

Statewide, lawmakers voted in 2022 to ban new oil wells within 3,200 feet (975 meters) of schools, homes and other community sites. The California Independent Petroleum Association is trying to get a referendum on the ballot to block the law. The state should announce by the end of February whether it qualified for the ballot, which would put the law on hold until voters weigh in.