Princess Cruise Lines Ltd. has agreed to pay a $40 million criminal penalty for deliberately polluting the ocean and covering it up, the U.S. Department of Justice announced Thursday.

The cruise line, a subsidiary of Miami-based Carnival Corp., will plead guilty to seven felony charges after a whistleblower reported the Caribbean Princess was using a so-called “magic pipe” to illegally discharge oily waste. The government investigation also uncovered illegal practices on four other Princess ships.