A crude-oil refinery in St. Paul Park was fined $40,000 for discharging cancer-causing benzene into an unlined lagoon next to the Mississippi River, the Minnesota Pollution Control Agency announced Thursday.

The alleged improper release of wastewater containing benzene may have polluted the river, the MPCA said. Two and a half years ago, the previous owner of the refinery was sanctioned for an even larger alleged release of benzene in the same manner, drawing a $700,000 fine.

MPCA spokesman Sam Brungardt said the new owner, Northern Tier Energy, has addressed the problem with a new $42 million wastewater treatment facility that opened in June. The previous treatment facility didn't extract benzene, and releasing contaminated wastewater into the lagoon violated the plant's pollution permits, the MPCA said.

"The company knew it was having problems with its wastewater treatment system before they released the hazardous waste benzene process wastewater,'' Brungardt said.

Paul Anderson, a spokesman for Northern Tier Energy, said the company doesn't believe it violated any of its permits relating to discharges of wastewater to the lagoon. He said Northern Tier agreed to pay the fine and meet four corrective actions as part of a stipulation agreement signed in January. As part of the agreement, the company did not admit any violations, according to the document.

"We are committed to safety'' and will continue to comply with regulations and work with the MPCA and other agencies, Anderson said.

He said the company invested in a new wastewater treatment plant because it was having difficulty getting replacement parts for the old one, which the company inherited in December 2010 when it purchased the facility from Marathon Petroleum.

Under the new treatment system, the lagoon is no longer needed because clean discharges are made directly into the river under an enforced permit, Anderson said.

The MPCA said that between Jan. 4, 2011, and Sept. 10, 2012, the refinery discharged more than 4 million gallons of wastewater into the unlined lagoon. The discharge contained an estimated 2.7 gallons of benzene, the MPCA said. "Benzene may have endangered water quality of the Mississippi,'' the MPCA said.

By comparison, Marathon was alleged by the MPCA to have disposed of 115 million gallons of wastewater containing 128 gallons of benzene into the unlined lagoon before it sold the plant to Northern Tier.

In the latest case, the MPCA said corrective actions assure that Northern Tier will properly handle and store hazardous waste. The plant, which refines an average of 96,500 barrels of crude oil per day, operates under the National Pollutant Discharge Elimination System for the management of wastewater that may contain petroleum contaminants.

In addition to the alleged wastewater violations by Northern Tier, the company was cited by the MPCA for failing to properly store a 55-gallon container of hazardous waste mercury. Northern Tier also owns the SuperAmerica chain of gas stations.