Bayern Munich coach Julian Nagelsmann breathed a sigh of relief when he crowned a challenging first season at the German powerhouse with his first Bundesliga title on Saturday, extending their run to 10 straight league wins.

"It felt great. I know how important it was to win it today," Nagelsmann, who had joined from RB Leipzig, said. "It moves the season into a better light. It is my first major title as well so it feels great."

Bayern beat second-placed Borussia Dortmund 3-1 in front of a 75,000-strong home crowd to move 12 points clear of them with three games remaining.

First-half goals from Serge Gnabry and Robert Lewandowski as well as a late goal from Jamal Musiala secured their title-sealing win with Dortmund cutting the deficit with a second-half penalty through Emre Can.

"It was not an easy season I have to say," said Nagelsmann who at 34 became the second-youngest coach to win the Bundesliga.

READ| De Bruyne and Ake played through fitness issues, says Guardiola

"I am not one to complain but a lot of things happened and we had setbacks. So I am happy to have won it. Had we not won today we would have to handle an unnecessary setback."

The Bavarians had suffered a shock Champions League quarterfinal exit to Villarreal earlier in the month, and had also crashed out of the German Cup second round with their heaviest ever defeat, a 5-0 thrashing by Borussia Moenchengladbach.

READ| Bayern Munich wins record 10th consecutive Bundesliga beating Dortmund 3-1 in Der Klassiker

That made winning the league mandatory.

"It has not been an easy season so that is why I am happy that we sealed it with the league title," Nagelsmann said.

"Next season I will be feeling the same pressure if not more, and hopefully we will be more successful in two of the three competitions and then also win the 11th straight league title."