Porsche conceded defeat in a months-long power struggle with Volkswagen Thursday by axing its embattled CEO, paving the way for VW to merge with the maker of the 911 sportscar.

As a way to improve its negotiating position with Volkswagen, Porsche also said it would raise at least 5 billion euros ($7.1 billion) in equity as the two companies prepared to create an integrated automotive group.

Volkswagen said it planned to buy a stake in Porsche AG, the company's financially healthy sports car business, and gradually expand this over time.

VW and Porsche would be fully merged by mid-2011, said Christian Wulff, premier of Lower Saxony, the German state that is VW's second largest shareholder.

I'm optimistic that we can lay out the details of our agreement in principle during a supervisory board meeting on August 13, he added.

He said the Gulf state of Qatar is set to buy a financial derivatives package that controls 17 percent of VW shares, in a further move to ease Porsche's financial woes. It could expand its stake by acquiring non-voting preferred shares.

Porsche shares ended the day up 0.3 percent at 51.75 euros, while Volkswagen was up 1.2 percent at 255.00 euros and the DJ Stoxx European autos index was 2 percent higher.

Porsche amassed more than 10 billion euros in debt during a botched attempt to build a 75 percent stake in VW. Weighed down by the debt, Porsche was forced to abandon further stakebuilding earlier this year and negotiate a merger instead.

But disagreements between the two companies about how to structure a deal held up negotiations.

Porsche's veteran chief executive, Wendelin Wiedeking, opposed a sale of Porsche to VW, clashing with Ferdinand Piech, the 72-year-old chairman of VW and grandson of Porsche's founder, Ferdinand Porsche.

THE LEGEND OF PORSCHE

Early Thursday Porsche said Wiedeking, CEO for the past 16 years and Germany's best-paid executive, would leave the group immediately along with finance chief Holger Haerter.

Speaking to workers assembled at Porsche's factory in Zuffenhausen, Germany, Wiedeking said he had decided to step down a week ago as it was time to draw a line behind Porsche's woes and move forward.

His and Haerter's hasty exit will be sweetened by severance deals of 50 million euros and 12.5 million euros. Wiedeking, who had been criticized by German media for his fat pay check, said in a statement his after-tax payoff would be used for charity.

Michael Macht, who succeeds Wiedeking as CEO, said Porsche now needed to strike a deal with VW on an equal footing. VW's CEO Martin Winterkorn gave assurances that Porsche would remain an independent brand within the Volkswagen group just like Audi.

Chairman Wolfgang Porsche said at the meeting Porsche aims to secure an independent future for Porsche as part of a globally leading manufacturer. Fighting back tears, he added that the legend of Porsche will not go under.

In the event of a sale, Porsche would become the 10th brand in Volkswagen's sweeping automotive empire.

What is good news is that decisions have at least been prepared. However, still a huge amount of questions (are) open, said MM Warburg analyst Marc-Rene Tonn.

The Porsche and Piech families, which trace their origins back to VW Beetle creator Ferdinand Porsche, will take up the bulk of Porsche's planned capital increase, several people familiar with the matter told Reuters.

The families could use the assets of their Salzburg-based Porsche Holding, Europe's largest auto dealership with annual sales of 13.7 billion euros, instead of cash, the sources said.

An analyst who asked not to be named agreed: I cannot think of another asset the families have.

It remained unclear whether Qatar would take a stake in Porsche voting shares, in Volkswagen, or in both.

The sources said Porsche's plan foresaw Qatar receiving the right to take up about 5 percent of Porsche's shares -- both ordinary and preferred -- in the capital increase, though it was undecided whether it would use this right.

Following the credit crunch, Porsche was forced to abandon its attempts to win control over 75 percent of VW, leaving it with a stake of nearly 51 percent and opening the door to VW's Piech, himself a part-owner of Porsche, to turn the tables on Porsche.

The audacious attempt to take over VW was one of Wiedeking's favorite examples of the small carmaker punching above its weight.

Because nobody had this on their radar, it struck like a thunderbolt, Wiedeking once said.

($1=.7030 euros)

(Additional reporting by Edward Taylor, writing by Knut Engelmann, editing by Will Waterman, Greg Mahlich and Karen Foster)