A group headed by Sony Corp. (SNE) agreed in principle to buy Hollywood film studio Metro-Goldwyn-Mayer (MGM) for nearly $5 billion on Monday, sources close to the deal said.

Comcast Corp. (CMCSA), the biggest U.S. cable operator, is considering plans to contribute about $300 million to the venture, the sources also said.

The deal came after rival bidder Time Warner Inc. (TWX) withdrew from the auction, saying it could not reach agreement on price.

Sony and its partners, who have pursued MGM since early this year, will pay $12 a share and assume slightly less than $2 billion in debt as part of the agreement, the sources said.

MGM's library of more than 4,000 films, including the James Bond (search), Pink Panther and Rocky movies, is considered its crown jewel — one that could generate a solid stream of revenue if Sony reformats the films for sale in the hot DVD market.

Sony, which bought Columbia Pictures (search) in 1989 for $3.4 billion, will take primary control for the distribution of MGM's films, sources said. Comcast might use the partnership to make the movies available through its video-on-demand service, or on cable TV channels it separately plans to launch with Sony, the sources said.

The move by Comcast highlights the company's growing interest in gaining access to the programming content that drives its cable business. Earlier this year, the company had made a bid to buy Walt Disney Co. (DIS), but finally withdrew the bid in April after Disney refused to negotiate.

Comcast declined to comment.

Both MGM and the Sony group declined comment on the deal.

The consortium, which also includes lead private equity investor Providence Equity Partners along with Texas Pacific Group and Credit Suisse First Boston's DLJ Merchant Banking Partners, proposed exclusive talks to finalize the agreement, the sources said.

The Sony group has paid a $150 million deposit that MGM will keep if a deal is not reached, the sources said.

Billionaire investor Kirk Kerkorian (search), who holds a 74 percent stake in MGM, stands to make about $2 billion in cash on the deal.

Time Warner, the world's biggest media group and owner of the Warner Bros. and New Line Cinema film studios, had offered a lower but more straightforward bid of $4.6 billion, according to a source close to the talks.

But Time Warner said in a statement on Monday that while MGM was a valuable asset, it could not agree on a price "that would have represented a prudent use of (Time Warner's) growing financial capacity."

Time Warner's decision to drop its bid once Sony upped the ante came as no surprise to many investors and analysts, who had expected the company to be prudent with its cash after a few painful years of debt-slashing and restructuring.

"We believe that the withdrawal from the MGM auction should be a positive catalyst for Time Warner as investors have been concerned about a dilutive acquisition," J.P. Morgan analyst Spencer Wang said in a research note.

Time Warner's decision frees it up to concentrate on the pending auction for bankrupt cable operator Adelphia Communications. Time Warner is interested in buying some or all of Adelphia, but many Wall Street analysts had predicted its role in that auction would have been reduced if it won the competition for MGM.

Sony and its partners have now locked in financing from J.P. Morgan Chase & Co. and Credit Suisse First Boston for the bid, sources close to the discussions said. J.P. Morgan is also leading a $4.2 billion debt financing for the deal.

Shares of MGM closed up 44 cents at $11.55. Shares of Time Warner were down 6 cents at $16.45.