A consortium led by Sony Corp. has agreed in principle to acquire famed Hollywood studio Metro-Goldwyn-Mayer Inc. for nearly $3 billion, MGM said late Monday. The deal is a coup for Sony, which as late as Sunday was considered the underdog in the bidding to Time Warner Inc., which dropped its offer Monday.

Acquiring MGM's vast library of more than 4,100 films boosts the content Sony can now offer on DVD and on portable devices, many of which Sony makes.

But the deal also marks the last chapter in the history of two of Hollywood's most storied names -- MGM, which once best known for its musical hits like "Singing in the Rain" and "Meet Me in St. Louis, " and United Artists, the studio founded in 1919 by Charlie Chaplin, Mary Pickford, Douglas Fairbanks and D.W. Griffith.

MGM bought United Artists in 1981 and has used the brand in recent years as a boutique studio, releasing low budget independent films.

MGM said it received a cash deposit of $150 million on Monday from Sony, along with private equity companies Providence Equity Partners Inc., Texas Pacific Group and DLJ Merchant Banking Partners.

MGM said its management will recommend the deal, which it called a "proposed merger," to its board by Sept. 27.

Sony has agreed to pay $12 per share for MGM, or about $2.94 billion cash -- a 4 percent premium over MGM's closing price of $11.55 Monday on the New York Stock Exchange. The deal also calls for Sony to assume about $1.9 billion in MGM debt. MGM shares rose 3.9 percent, or 44 cents, on speculation of a pending deal, and then gained another 5 cents in extended trading.

The sale would mark the third time billionaire investor Kirk Kerkorian has sold the film studio. Through his Tracinda Group, Kerkorian owns 74 percent of MGM's outstanding shares and the sale to Sony would net him about $2.1 billion.

MGM paid a special one-time dividend of $8 per share in May, saying it was the best way to return value to shareholders. That transaction paid Kerkorian about $1.4 billion and resulted in MGM's $1.9 billion debt.

For the past two years, MGM has been hunting ways to grow larger, either through acquisitions or mergers.

The company made an $11.5 billion all-cash bid for Vivendi Universal Entertainment last year, but lost that contest to NBC.

Sony is expected to shutter MGM's current production, with the possible exception of the "James Bond" franchises.

But MGM has a considerable library of more than 4,100 titles, including the "Pink Panther" and "Rocky" franchises. Analysts have estimated MGM's library will generate $440 million in cash flow in 2004 by exploiting only 1,500, or about 36 percent, of its titles on the newer DVD format.

Time Warner had been seen as the front-runner for MGM going into the weekend. But Sony raised its offer, setting off a bidding war that Time Warner concluded it did not want.

"As we pledged to our shareholders, we approach every potential acquisition with strict financial discipline," Time Warner chairman and chief executive Dick Parsons said. "Unfortunately, Time Warner could not reach agreement with MGM at a price that would have represented a prudent use of our growing financial capacity."

Parsons, who has often said Time Warner is interested in expanding its presence in cable television, hinted Monday that the cash it saved from the MGM bid could be used to bolster its cable presence. "We are confident that there are other capital allocation choices that will enable us to continue to build shareholder value," Parson said.

Time Warner is known to be interested in bidding on the cable assets of bankrupt Adelphia Communications Corp.

Sony has also approached cable television giant Comcast Corp. about becoming a minority investor in the new company after the Sony/MGM deal closes, although no deal has been reached, according to a source familiar with those discussions.

Comcast and Sony have reached a deal to distribute Sony's Columbia/Tri-Star film library on Comcast's video-on-demand platform, the source said. The deal also includes Sony and Comcast developing new movie cable channels.

That deal could expand to include MGM's library of films and result in Comcast making an investment in the new company.

A Comcast spokeswoman declined to comment.

Sony shares gained 53 cents Monday to close at $35.82 on the New York Stock Exchange.