Volkswagen (VW) and Porsche have agreed the details under which VW will merge with its German compatriot by 2011. Under the deal, VW will initially buy a 42% stake in Porsche by the end of this year for 3.3bn euros ($4.7bn; £2.8bn). The deal ends months of acrimony between the two firms, and formally ends Porsche's efforts to buy VW. Over the past year Porsche 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. Funding failure 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. It failed to raise the funds to increase its shareholding in VW above 51% due to the impact of both the global credit crunch and the slump in global car sales. Porsche will now effectively become the 10th brand in the VW family, joining the likes of Audi, Seat and Skoda. However, VW has pledged to maintain Porsche's "independence". It added that VW would "preserve" its own "solid financial base". The deal values Porsche at 12.4bn euros.