SeaWorld Entertainment Inc. on Thursday said it would stop breeding killer whales across its theme parks, ending a legal battle with the California Coastal Commission.

The commission had approved SeaWorld’s $100 million expansion of the Blue World orca habitat, but only if SeaWorld San Diego stopped captive breeding. SeaWorld had appealed the decision, but on Thursday said it would stop breeding immediately.

“This will be the last generation of orcas in SeaWorld’s care,” CEO Joel Manby wrote in an op-ed in the Los Angeles Times, noting that SeaWorld hadn’t collected any wild orcas in nearly 40 years.

SeaWorld will also phase out its theatrical killer whale shows across all its parks and replace them with “natural orca encounters” beginning next year. SeaWorld had announced last year it would stop those shows in San Diego.

SeaWorld’s orca shows and its treatment of the animals have been a consistent source of criticism for the company after the 2013 documentary “Blackfish” accused the park of mistreating its star attraction.

The announcement comes less than a month after SeaWorld promoted the San Diego park’s president, John Reilly, to oversee all of the company’s theme parks beginning April 1.