Robert Lewandowski scored a hat-trick taking him to 31 Bundesliga goals for the season and sealing Bayern Munich's 4-2 comeback over Borussia Dortmund in Germany's 'der Klassiker'. Dortmund raced into a 2-0 lead as Erling Haaland netted twice in the first nine minutes behind closed doors at the Allianz Arena in Munich. However, Lewandowksi struck twice, the second from the penalty spot, to haul Bayern level before the break. Leon Goretzka put Bayern ahead for the first time with only two minutes left before Lewandowski completed his hat-trick on 90 minutes. "The quality is certainly there, that's our DNA," said veteran Thomas Muller of Bayern's fightback. The win leaves Bayern two points clear of RB Leipzig at the top of the table. "We shook ourselves up at 2-0 down and deserved to win because we were the dominant team for the last 60 minutes," Bayern coach Hansi Flick said. Bayern have won the last five meetings between the clubs. "We weren't good enough. We started well, but didn't play good enough football. We should have been more brave," Dortmund midfielder Emre Can said. The match delivered on its billing as the battle of the Bundesliga's star strikers. Haaland scored after two minutes, his shot clipping the heel of Jerome Boateng, helping it into the net. Bayern were reeling after nine minutes when Thorgan Hazard flicked the ball back inside for Haaland to smash home. Dortmund could have been 3-0 up on 25 minutes but Thomas Meunier squandered a chance to shoot. A minute later, Bayern pulled a goal back when Leroy Sane squared for Lewandowski to score. Bayern went into the break level when Mahmoud Dahoud brought down Kingsley Coman in the penalty area and Lewandowski converted the spot-kick. After a frantic first-half, the tempo dropped in the second as both teams suffered key injuries. Haaland came off after an hour gone with a cut on the back of his ankle. With ten minutes left, Boateng had to be helped off in clear discomfort after twisting his knee. Dortmund were left fuming for what captain Marco Reus claimed was a foul on Can late on. "It was a clear foul – if that had been against Bayern, it would have been given," Reus said. Bayern settled the matter when Goretzka pinged his shot in off the post before Lewandowski completed his hat-trick with an outstanding low drive. "We started great and ended very badly," Dortmund coach Edin Terzic said. With ten games left, Lewandowski threatens to break Gerd Mueller's all-time record of 40 Bundesliga goals in the 1971/72 season. Earlier, RB Leipzig briefly climbed top of the table with a 3-0 romp at Freiburg thanks to goals by Christopher Nkunku, Alexander Sorloth and Emil Forsberg.