Volkswagen (VW) and Porsche have agreed the details under which both will merge by 2011.

VW will initially buy a 42% stake in Porsche before the end of this year for £2.8 billion.

The deal potentially puts an end to months of bad blood between the two companies and follows Porsche’s failed efforts to buy VW.

Over the past 12 months Porsche has built up major debts to get a 51% stake in VW, only to fall short of the required 75% when it could not raise more funds.

Porsche's failure to buy VW saw the firm's former chief executive Wendelin Wiedeking and financial director Holger Haerter resign "with immediate effect" last month.

VW has said Porsche will maintain its independence with its own “solid financial base”. The deal values Porsche at £10.7bn.