A federal judge has approved a settlement clearing the way for Paramount to complete its $110 billion acquisition of Warner Bros. Discovery after months of antitrust litigation.

U.S. District Judge Araceli Martínez-Olguín entered an order Wednesday approving the settlement between Paramount, Warner Bros. Discovery and a group of 12 state attorneys general led by California. The ruling removes the remaining legal hurdle that had prevented the transaction from closing.

The states had sued to block the merger, arguing that combining the major entertainment companies could reduce competition in the film and television industries. After months of litigation, the parties reached a settlement that imposes several conditions on the combined company.

Under the agreement, Paramount will be required to invest at least $300 million annually in U.S. film and television production for five years. The company will also have to release at least 30 films per year in theaters during the first two years and 32 films annually during the following three years.

The settlement also includes requirements involving theatrical release windows, cable-network distribution and oversight of news operations. Paramount will establish an independent oversight board at CNN and CBS News, while continuing to operate the Pluto TV streaming service.

The agreement includes enforcement measures if Paramount fails to meet its obligations. Those measures can include financial penalties and, under certain circumstances, the forced divestiture of assets including Paramount's 49% stake in Miramax and several cable networks.

Paramount CEO David Ellison has previously said the transaction was expected to close shortly after the settlement received court approval. The $110 billion deal will combine Paramount's entertainment properties with Warner Bros. Discovery's extensive film, television, and streaming assets.

The approval ends a significant legal fight over the proposed merger and allows the companies to move toward completing the transaction in early October.