Bayern Munich great Giovane Elber is confident Robert Lewandowski will spurn interest from Real Madrid in order to remain at Allianz Arena.

Lewandowski eclipsed former Brazil forward Elber as the most prolific foreigner in Bayern's history by notching a hat-trick in the 6-0 crushing of Hamburg on Saturday.

The treble elevated his tally to 142 competitive goals for the Bavarian club, surpassing Elber's previous record of 139.

But rumours of an off-season exit were fuelled by Lewandowski's hiring of Pini Zahavi as his agent in February.

Cristiano Ronaldo has reportedly given Madrid his blessing to pursue the Poland international as a successor to Karim Benzema.

"This shows that Cristiano Ronaldo is not stupid. Everyone wants to have such a player in their team," Elber told Abendzeitung Munich.

"If they have the opportunity to get Lewandowski away from Bayern they will do their best to do it. But Bayern is warned and Lewandowski feels very [happy] with his family here in Munich.

"He knows he has everything at Bayern. I hope and expect that he stays with us for a long time."