(Reuters) - California's attorney general on Monday sought to force the world's biggest oil companies to give up profits the state alleges they made while deceiving consumers about their role in contributing to climate change.

The legal action comes months after a new state law went into effect that allows the attorney general to seek profits obtained from companies while they violated laws against unfair competition and false advertising.

Attorney General Rob Bonta added the so-called disgorgement remedy to a lawsuit filed last year against Exxon Mobil, Chevron, Shell, BP, ConocoPhillips and oil and gas industry trade group the American Petroleum Institute (API).

The suit, filed in state court in San Francisco, alleges the energy giants have caused tens of billions of dollars in damages and accuses them of deceiving the public.

API called the suit without merit.

"This ongoing, coordinated campaign to wage meritless, politicized lawsuits against a foundational American industry and its workers is nothing more than a distraction from important national conversations and an enormous waste of taxpayer resources," API General Counsel Ryan Meyers said in a statement. "Climate policy is for Congress to debate and decide, not a patchwork of courts."

Exxon, Chevron, Shell, BP and ConocoPhillips were not immediately available for comment.

The filing comes days after United Nations Secretary-General Antonio Guterres called on countries to ban fossil fuel advertising as many do for tobacco and other products that have proven harmful to human health.

In recent weeks, major oil and gas companies have fought back against activist shareholders urging more corporate climate action while some U.S. lawmakers have stepped up probes into whether the industry is behaving deceptively.

(Reporting by Nichola Groom in Los Angeles and Valerie Volcovici in Washington; Editing by David Gregorio)