LONDON (AP) _ Germany's BMW has agreed to sell Rover to a consortium that had been seeking to take over the British-based struggling car business in a last-ditch effort to save thousands of jobs, the companies announced today.

BMW and the Phoenix consortium, headed by former Rover chief executive John Towers, said contracts had been signed and completed following several days of negotiations.

Phoenix said it will take over responsibility for the development, production and distribution of Rover cars, and also will acquire the MG brand.

The consortium said it would continue building the Rover 25, 45 and MG sports car at the huge Longbridge factory in Birmingham, central England.

``After intensive negotiations, we have managed to find a buyer for Rover whose aim is to continue running Rover and to therefore prevent the loss of thousands of jobs in the Rover plant in Birmingham, in the supply industry and in the retail business,'' BMW chairman Joachim Milberg said.

The two sides held their first round of talks last week after the collapse of negotiations between BMW and its preferred buyer, British venture capital firm Alchemy Partners.

BMW was eager to dump Rover after failing for six years to stem the group's losses. It warned that it would shut down Rover's car operations if it didn't find a buyer by the end of May.

``We are delighted that together with BMW we have secured a brighter future for Rover and its stakeholders,'' Towers said. ``This is the first step in a series of changes which will fully justify the confidence and support which has kept this process going.''