The 25-year-old has been at Dortmund since the 2010-11 season, but his current contract was due to expire in June, and the Bavarian giants revealed he will join their ranks on July 1.

"We're delighted both parties have today signed a five-year contract until 2019," Bayern chairman Karl-Heinz Rummenigge, who was present for the signature along with sporting director Matthias Sammer after Lewandowski underwent a medical.

"Robert Lewandowski is one of the best strikers in the world," said Rummenigge. "We're very pleased about completing this transfer. He will strengthen the Bayern squad and give us another boost."

Lewandowski had informed Dortmund bosses last summer that he wanted to leave, but the club refused having already been hit by the departure of German midfielder Mario Goetze for Bavaria in a 37-million-euro deal.

But he had dropped a heavy hint that he planned to join Bayern Munich two weeks ago after responding in Bavarian to a question about his future.

"Schaun mer mal ('let's wait and see' in Bavarian)," Lewandowski told German daily Bild when asked about a possible move to Munich.

Since his arrival in 2010 from Lech Poznan, Lewandowski had helped Dortmund win the league title in 2011 and 2012.

His 11 goals this season have helped his team to fourth place in the Bundesliga, but they are 12 points behind runaway leaders Bayern.

The Pole was also a key player in the Dortmund's European campaign last season, scoring four goals against Real Madrid in the Champions League semi-finals before falling to Bayern in the final in Wembley.

Rummenigge, meanwhile, ruled out speculation of a move for Chelsea defender David Luiz.

"There's a lot of speculation ... we're being linked with David Luiz and other Spanish players at the present time," he said.

"Let me state this very clearly: it's all of no interest whatsoever to us. What I'd personally like is for Holger Badstuber to make a comeback."

German centre-back Badstuber underwent a fourth operation in October on right knee ligaments he has twice ruptured.