Paramount Pictures on Sunday agreed to buy independent film studio DreamWorks SKG Inc. (DWA) for nearly $1 billion cash in a deal designed to help both companies reverse their troubled fortunes.

The sale marks the end of an 11-year dream for Hollywood moguls Steven Spielberg, Jeffrey Katzenberg and David Geffen, who had ambitious goals for DreamWorks that once included television, music, films and the Internet.

Moreover, the DreamWorks acquisition is seen as a critical gambit for Paramount, which has been under orders from parent company Viacom Inc. (VIA) to improve the quality of both its movies and earnings.

Paramount will pay $775 million in cash and assume $825 million in debt and other obligations, the company said.

"We see this at Paramount as a transforming event for the studio," said Brad Grey, Paramount's chairman and CEO.

The studio will finance the deal by immediately selling the DreamWorks film library, which Paramount values at between $850 million and $1 billion. The company said it is in advanced talks with several parties and expects to have a deal within weeks.

Paramount will retain distribution rights to the 59 library titles, which includes such hits as Oscar-winners "American Beauty" and "Gladiator." The company is not likely to sell the library to a rival studio but to an investment group that would pay Paramount fees to distribute future products derived from the films.

The agreement does not include DreamWorks Animation SKG Inc., which was the most profitable part of the company. The animated unit went public last year. Paramount does gain the right to distribute the animated studio's lucrative films for the next seven years, including the profitable "Shrek" franchise.

It will also have the right to make television shows using DreamWorks Animation characters.

Grey said the arrangement with DreamWorks Animation makes Paramount a larger player in family and children's movies. Paramount already produces films with Viacom's Nickelodeon and MTV cable channels.

Upon completion of the deal, expected to close early next year, Paramount would sign new employment agreements with Spielberg as a producer and director, and Geffen, who will become chairman of DreamWorks.

Spielberg and Geffen will be responsible for producing four to six live action films a year, Paramount said. The move will increase its overall annual production to between 14 and 16 titles annually.

Paramount put its offer together just last week, after DreamWorks had been discussing terms with NBC Universal, a unit of General Electric Co., for nine months.

NBC Universal made an offer in September, then reduced it at the last minute. That angered Geffen, who said he was still talking to NBC Universal as late as Friday before finally accepting the Paramount offer.

"We tried very, very hard to conclude a deal with General Electric, which we were never able to do," Geffen said.

Geffen said Paramount was able to produce completed contracts within a week, something GE never did.

A deal with NBC Universal had been considered more likely because of Spielberg's long ties to Universal, which gave him his first jobs directing TV shows and eventually feature films.

In fact, even after agreeing to be bought by Paramount, DreamWorks will continue to have its main offices on the Universal lot because of Spielberg's desire to remain there, Geffen said.

DreamWorks will be given the same budget it has always enjoyed to make its films, and Spielberg will retain the same freedom he has had to partner with other studios to work on projects that interest him, Geffen said.

The deal makes sense in the short term for Paramount, which was in much bigger need of an immediate boost in production and prestige, according to Harold Vogel, a longtime media investor and head of the Vogel Capital Management investment firm.

"Basically, GE was book smart and Paramount was street smart," Vogel said. "They're aggressive, they're hungry and they figured they could pay the price," Vogel said of Paramount. "GE was counting the beans."

DreamWorks had grand ambitions when it was created in 1994.

But the company was forced to scale back its ventures over the years. It abandoned plans to build a high-tech studio lot in Los Angeles in 1999, sold DreamWorks Records to Universal Music Group in 2004 and has curtailed its TV production. Its Internet site, Pop.com, also folded.

DreamWorks has had some hits over the years and more than its share of misses, including the $120 million sci-fi thriller "The Island," which tanked at the box office this summer.

The studio has found it harder to survive as an independent company. Last year, it spun off its animation division in part to repay its initial investors, including billionaire Paul Allen.

Difficulties at DreamWorks Animation over income shortfalls caused its stock price to falter and forced it to cancel plans for a secondary offering that would have raised the money to repay Allen.