mario gomez scored a 90th-minute winner to give the hosts a narrow advantage after mesut özil had cancelled out franck ribéry's opener.
a close-range strike from mario gomez in the 90th minute gave fc bayern münchen the narrowest of advantages in their uefa champions league semi-final against real madrid cf.
franck ribéry had given the german side a first-half lead but the visitors improved either side of the break and equalised early in the second period through mesut özil. however, gomez's 12th goal in this season's competition in the final minute ensured it is bayern who will go into next wednesday's second leg at the santiago bernabéu confident of returning to their home ground for the final on 19 may.
even before kick-off the home fans had made it abundantly clear how much the game meant and their vociferous support helped bayern to settle early on with some encouraging spells of possession. madrid's experience in high-profile situations meant they were not about to be intimidated, however, and it was the visitors who created the first chance when özil fed karim benzema, whose fierce strike from the right was palmed over by manuel neuer.
an ominous silence gripped the munich crowd as the liga leaders grew in confidence, but their fear turned to elation on 17 minutes as ribéry slammed in the opener with a low shot after madrid had failed to deal with toni kroos' left-wing corner. the goal visibly calmed jupp heynckes' side and though cristiano ronaldo went close with a trademark free-kick shortly afterwards, it was the bavarian club in the ascendancy heading towards the interval.
bastian schweinsteiger fired narrowly wide from range and gomez had a powerful first-time effort with his left foot tipped over by iker casillas. as benzema warned when he tested neuer after cutting in from the right between times, madrid's threat was far from extinguished.
any lapses were likely to be punished and following a bright start to the second period, madrid capitalised on a misjudged clearance by david alaba to outnumber the bayern defence. neuer did well to deny ronaldo in the first instance, but madrid retrieved the loose ball and, though benzema scuffed his shot across the face of goal, it fell kindly for ronaldo to turn back inside and özil duly levelled from close range.
initially bayern looked ruffled but soon regained their composure and set about restoring their lead. having been kept quiet for most of proceedings, top scorer gomez began to impose himself on the game. the striker blazed a glorious opportunity over the bar after another kroos set piece had caused problems in the visiting defence, before heading a philipp lahm cross narrowly too high.
the combination threatened once more in the latter stages as lahm again set up for gomez to head into casillas' arms with five minutes remaining. the madrid goalkeeper was eventually beaten again in the final moments as gomez slid in to convert yet another lahm delivery and edge the bundesliga giants a step closer to that dream home final.