* Carmakers' boards approve integration steps

* VW to get stake in Porsche AG sports car business

* Goal is creating German automotive juggernaut

* VW shares close flat, Porsche up 1.6 pct before news (Updates with deal details, changes dateline from FRANKFURT, new throughout)

Volkswagen on Thursday agreed to buy a 42 percent stake in the sports car unit of debt-ridden Porsche SE , another step toward combining the two German carmakers into a European automotive giant.

VW will pay up to 3.3 billion euros ($4.7 billion) this year for the initial stake in the unit, Porsche AG, paving the way for the creation of an integrated automotive group by the end of 2011, VW and Porsche said in statements after board meetings.

Volkswagen Chief Executive Martin Winterkorn, who is poised to run the combined entity and was named head of Porsche SE on Thursday, said the deal marked a new era for both companies.

Porsche is a real enrichment for our company's portfolio, he said.

The combined company will have 10 brands, adding the Porsche marque to a stable that already includes Audi, Bentley, Bugatti, Skoda, Seat and Lamborghini.

To finance the purchase, Volkswagen plans a capital increase of preference shares in the first half of 2010, VW said.

Porsche's surrender comes at the end of a months-long power struggle that eventually led to the departure of Porsche Chief Executive Wendelin Wiedeking. It marks a triumph for Volkswagen CEO Winterkorn and VW Chairman Ferdinand Piech.

Porsche had sought to seize control over Volkswagen -- already Europe's biggest carmaker -- as a way to gain access to key components and technologies it needs to meet stringent new pollution rules. That left it with just over half of VW votes.

But Porsche's takeover attempt backfired after it took on more than 10 billion euros in debt, forcing it to seek help from Volkswagen. VW supplies components for about a third of all Porsche cars, including bodies of the four-door Cayenne and Panamera models.

VW's powerful labour chief welcomed the agreement.

Today industrial history was made, Bernd Osterloh said.

PAYING DOWN DEBT

In a further step to alleviate Porsche SE's debt, Porsche's controlling families will sell their automobile trading business, Europe's largest, to Volkswagen. The business, with an enterprise value of 3.55 billion euros, will be sold by 2011.

Porsche also aims to raise capital by issuing new ordinary and preferred shares, probably in the first half of 2011.

The Porsche and Piech families will remain the largest shareholders in the company to arise from the combination of VW and Porsche SE, Winterkorn said.

VW's home state of Lower Saxony, which owns a stake of 20 percent in Volkswagen, will retain the right to block important decisions and to nominate two members of the supervisory board.

The completion of the sweeping deal depends on the approval of Porsche creditor banks and a final clarification of structural issues, Porsche said.

The deal is set to make the Gulf state of Qatar the third-largest investor in the combined company, VW's CEO said, without specifying how large a stake they will hold. (Reporting by Edward Taylor, Arno Schuetze and Hendrik Sackmann; Editing by Gary Hill)