Carnival’s Princess Cruise Lines will plead guilty to seven felony charges of polluting the seas and trying to cover it up, and pay a record $40 million criminal penalty, the U.S. Justice Department said on Thursday.

The charges against Carnival’s Santa Clarita, California-based unit stem from “illegal dumping of oil contaminated waste from the Caribbean Princess cruise ship” tied to stops at ports in nine U.S. states and two territories, the department said in a statement.

The Caribbean Princess had been making illegal discharges since 2005 using bypass equipment—including a so-called “magic pipe”—to circumvent pollution-prevention equipment that separates oil and monitors oil levels in the ship’s water, the department said.

U.S. investigators began to probe the ship’s actions after a whistle-blower engineer reported an illegal dump off the coast of England in August 2013. Two other top ship engineers then ordered a cover-up, called on subordinates to lie and sought to remove the pipe.

“This is a company that knew better and should have done better,” assistant attorney general John Cruden said in the statement. “Hopefully the outcome of this case has the potential not just to chart a new course for this company, but for other companies as well.”

 

The ports linked to the charges were in Florida, Maine, Massachusetts, New Jersey, New York, Rhode Island, South Carolina, Texas and Virginia, as well as the U.S. Virgin Islands and Puerto Rico, the department said.