The deal should be finalised on Thursday when the Germany international undergoes a medical in Bavaria before signing a four-year deal.

"FC Bayern fulfilled our expectations, so we agreed to the transfer given the circumstances," said Bremen coach Klaus Allofs.

"We know that we are losing a successful player but Miro's change of heart coupled with Bayern's new offer has changed the situation from how things were at the end of the season.

"It has persuaded us not to continue the current contract."

Transfer rumours first began when an alleged secret meeting between Bayern general manager Uli Hoeness, coach Ottmar Hitzfeld and Klose in April was made public by the German media.

Bremen accused Bayern of breaching FIFA rules, but an investigation by the German Football Association (DFB) absolved Bayern of any wrong-doing.

Soon after Klose revealed he wanted to join Bayern, and it seemed he had already made the move mentally as the 2005 Bundesliga top goalscorer found the back of the net only once more after that meeting.

Bremen refused to alter their stance that Klose would still be their player, but the striker then admitted last month he had agreed to join Bayern by 2008.

"I would prefer for it to happen as quickly as possible and to have everything clear, but if I have to stay one more year in Bremen, then I will still give everything to Werder," Klose said at the time.

That has now been brought forward 12 months with the two clubs reaching an agreement for the player on Tuesday.

"We've arrived at a fair solution for both sides," Bayern chairman Karl-Heinz Rummenigge said.

Although the transfer fee has not been disclosed, it is expected to take Bayern's summer spending past the 70 million-euro (£47million) mark.

Luca Toni, Franck Ribery, Jose Ernesto Sosa, Hamit Altintop, Marcell Jansen, Ze Roberto and Jan Schlaudraff have already joined the club.

Bayern will begin their preparations for the new Bundesliga season on Friday when they return to training.