Metro-Goldwyn-Mayer closed a $1 billion five-year revolving credit facility that includes a $250 million optional accordion and a new $850 million five-year term loan A.

The facility provides MGM with the necessary funding for its $1 billion acquisition of the 80.9% of Epix the studio did not previously own, which was formerly held by Viacom and Lionsgate. That deal also closed Thursday, giving MGM sole control of Epix’ four linear TV channels.

Arranged by J.P. Morgan Chase with a syndicate of lenders, the credit facility lowers MGM’s borrowing rate to LIBOR + 2.00%, augments certain other terms from the company’s prior credit agreement, and provides MGM with significant financial flexibility to continue executing on its strategic growth initiatives.

The credit facility was oversubscribed by more than 50% and the new capital facilitates MGM’s acquisition of the 80.9% aggregate membership interests in EPIX held by Viacom, Paramount and Lionsgate for approximately $1 billion. MGM’s full acquisition of EPIX also closed.

“The speed of execution, favorable terms and flexible structure of our credit facility, which was substantially oversubscribed, is indicative of MGM’s solid financial position and strong relationships with the financial community,” said Gary Barber, MGM’s chairman and CEO. “I would like to thank all of our lenders for their tremendous support of MGM and our acquisition of EPIX. This transformative transaction is an important milestone in the continued growth trajectory of MGM.”