An oil company pleaded guilty Thursday to negligently discharging crude off the coast of Huntington Beach when its underwater pipeline ruptured last year, a federal official said.

Houston-based Amplify Energy and two of its subsidiaries each pleaded guilty to a misdemeanor charge in federal court on Thursday, said Thom Mrozek, a spokesman for the U.S. attorney’s office in Los Angeles.

The companies are expected to be sentenced later in the day, he said.

The plea comes after the companies agreed with federal prosecutors to pay a $7 million fine and nearly $6 million in expenses incurred by agencies including the U.S. Coast Guard after Amplify’s pipeline broke off the Orange County coast, spilling about 25,000 gallons of oil into the Pacific Ocean. The rupture shuttered beaches for a week and fisheries for more than a month, oiled birds and threatened local wetlands.

In the plea agreement, Amplify also agreed to install a new leak detection system for the pipeline that ferried crude from offshore platforms to the coast. They also said they’d train employees to identify and respond to potential leaks. Federal authorities said the company and its subsidiaries failed to respond to eight leak detection alarms over a 13-hour period that should have alerted workers to the October 2021 spill.

Amplify contends that two ships dragged their anchors across the pipeline and damaged it during a January 2021 storm, but the company wasn’t notified about the dragging until after the spill. Without this damage, Amplify has argued that the spill would not have happened.