LAFAYETTE — A federal judge has ordered CITGO Petroleum to pay $9 million in penalties for a major oil spill in 2006 at the company’s Lake Charles refinery.

U.S. District Judge Richard Haik filed the ruling this week following a trial earlier this year in a federal Clean Water Act lawsuit brought by the Justice Department.

Haik ordered CITGO to pay $6 million to the federal government and another $3 million to the state of Louisiana.

That’s far below the more than $240 million in penalties sought by Justice Department attorneys, who argued that CITGO put profits before safety in not paying for upgrades that might have prevented the spill.

Haik wrote in his ruling that there was a need to balance the seriousness of the oil spill with the oil company’s response efforts and the ultimate impact, “which could have been much worse under the circumstances.”

The judge also mandated that CITGO perform several upgrades that could help prevent future spills at the refinery.

“Given the evidence presented, it is likely that a situation such as the 2006 discharge is likely to happen again if some measures are not taken to improve the CITGO facility,” Haik wrote.

The company “quickly and effectively” worked to minimize the impact of the 2006 spill, said CITGO spokeswoman Dana Keel, reading from a prepared statement on Haik’s ruling.

“The massive cleanup efforts by CITGO demonstrated its commitment to preventing future releases, as shown by evidence during the lengthy trial last spring,” Keel said.

CITGO has already paid a $13 million fine after pleading guilty in 2008 to a criminal charge in the spill.

At issue in the lawsuit was not whether CITGO was at fault in the spill but rather how much oil actually spilled and how much the company should be penalized.

The spill occurred during unusually heavy rains in the Lake Charles area that caused two “slop oil” tanks to overflow into a containment area and then into the Calcasieu River and other waterways in the area.

Slop oil is a mixture of oil, water and other waste substances from the refining process.

Federal regulators had argued that 76,800 barrels of waste oil flowed into area waterways, while experts with CITGO argued that the amount was 54,000 barrels.

Haik wrote in his ruling that there was not sufficient evidence to determine the exact amount but that he found CITGO’s figure to be more reasonable, and he used the lower amount as a factor in calculating the penalties.

In addition to the criminal and civil fines, the oil company spent about $65 million on cleanup efforts, according to figures cited in Haik’s ruling.

“Although the environment was significantly impacted, the evidence shows that it has made a good recovery over the following years,” Haik wrote. “The court finds this is the result of a well executed cleanup effort.”

But the judge also noted in his ruling that CITGO “does not appear to have recognized the importance” of pollution control and environmental responsibility.

The trial in the lawsuit against CITGO was held in March and April, and Haik took the case under advisement for the summer before issuing the ruling this week.