The settlement includes five refineries Tesoro operates in Kenai, Alaska; Anacortes, Washington; Salt Lake City, Utah; Mandan, North Dakota; and Martinez, California, said officials at the Department of Justice (DoJ) and the Environmental Protection Agency (EPA). It also covers Par Hawaii’s refinery in Kapolei, Hawaii.

Under the consent decree filed in federal court in Texas Monday, the companies will spend $403 million to install equipment to control emissions at the refineries, which process crude oil into gasoline, diesel fuel and other products.

Tesoro, based in San Antonio, Texas, will also spend $12 million for environmental projects in communities affected by the pollution.