The agreement with Tesoro Corp. and Par Hawaii Refining resolves alleged violations of the federal Clean Air Act and requires installment of new equipment to control emissions.

It covers five refineries that Tesoro operates in Kenai, Alaska; Anacortes, Washington; Salt Lake City, Utah; Mandan, North Dakota; and Martinez, California. It also covers Tesoro's former refinery in Kapolei, Hawaii, which is now owned by Par Hawaii Refining

Under the consent decree, the companies will spend about $403 million to install equipment to control carbon dioxide, sulfur dioxide and other emissions at the refineries that process crude oil into gasoline, diesel fuel and other products.

Federal officials say the settlement will improve air quality for people and the environment because the installed equipment will reduce pollutants, including an estimated 47,000 tons of carbon dioxide annually.

Leaks, flares and excess emissions from the refineries emit dangerous air pollutants known or suspected to cause cancer, birth defects, and seriously harm the environment, the officials said.

Tesoro will also spend about $12 million on three environmental improvement projects, including $1 million to replace old diesel school buses with new buses powered by natural gas in Contra Costa County, California. The San Antonio, Texas, company will also pay a $10.5 million civil penalty.

Tesoro said in a statement Monday that it agreed to settle the case by making the investments to reduce emissions but did not admit any violations. The company added that most of the projects to reduce emissions have been completed or are in progress, with about $75 million of work left to do after the end of this year.

"We are dedicated to operating in a safe and responsible manner that reduces the impact on the environment," said Keith Casey, Tesoro's executive vice president of operations.

Par Pacific Holdings Inc., the parent company of Par Hawaii Refining, said the alleged violations occurred before it acquired the refinery from Tesoro in September 2013. In a statement, Par Pacific said Tesoro will reimburse it for capital expenditures and fines related to the consent decree.

The agreement was filed Monday in U.S. District Court for the Western District of Texas, along with the complaint filed by the federal government, the states of Hawaii and Alaska and the Northwest Clean Air Agency that regulates air quality in northwestern Washington state.

The states will get $2.4 million of the $10.5 million penalty, with the rest going to the federal government.

In addition to the new school buses, Tesoro will also install infrared cameras at four refineries to detect leaks and spend about $11 million to install equipment on a furnace at its Salt Lake City refinery to reduce nitrogen oxide emissions.