Philippe Coutinho scored a hat trick and set up two more goals as Bayern Munich came from behind to rout Werder Bremen 6-1 and end a two-game losing run in the Bundesliga on Saturday.

Robert Lewandowski scored two and substitute Thomas Müller grabbed the other as Bayern bounced back from successive 2-1 defeats to Borussia Mönchengladbach and Bayer Leverkusen.

Bremen's visit came just at the right time for the seven-time defending champion. Bremen had lost its previous 20 competitive games against Bayern, 17 in the league and three in the German Cup.

Bayern's scorer Philippe Coutinho, front, celebrates after scoring his side's sixth goal during the German Bundesliga soccer match between FC Bayern Munich and SV Werder Bremen in Munich, Germany, Saturday, Dec. 14, 2019. (AP PhotoMatthias Schrader)

Bayern's scorer Philippe Coutinho, front, celebrates after scoring his side's sixth goal during the German Bundesliga soccer match between FC Bayern Munich and SV Werder Bremen in Munich, Germany, Saturday, Dec. 14, 2019. (AP PhotoMatthias Schrader)

But Florian Kohfeldt's team gave the home side an early scare when Milot Rashica opened the scoring by rifling a shot from outside the penalty area past Manuel Neuer in the 24th minute.

Jiri Pavlenka denied Lewandowski in the 40th, when the Poland star only had the goalkeeper to beat, and then saved Coutinho's effort from the rebound.

But the Bremen 'keeper was beaten twice before the break. Serge Gnabry gave Coutinho a tap-in in the 45th and the Brazilian set up Lewandowski to break his two-game scoring drought in first-half injury time. Lewandowski had scored in the first 12 games of the season, a record, before an unexpected dry spell.

Bayern's Robert Lewandowski celebrates after scoring his side's fourth goal during the German Bundesliga soccer match between FC Bayern Munich and SV Werder Bremen in Munich, Germany, Saturday, Dec. 14, 2019. (AP PhotoMatthias Schrader)

Bayern's Robert Lewandowski celebrates after scoring his side's fourth goal during the German Bundesliga soccer match between FC Bayern Munich and SV Werder Bremen in Munich, Germany, Saturday, Dec. 14, 2019. (AP PhotoMatthias Schrader)

Coutinho's second goal in the 63rd all but sealed the win, but the goals kept coming with Lewandowski grabbing his second in the 72nd, Coutinho setting up Thomas Müller in the 75th and completing his hat trick in the 78th.

Goals from Marco Reus, Jadon Sancho, Thorgan Hazard and Nico Schulz gave third-place Borussia Dortmund a 4-0 win in Mainz — its fourth consecutive win since its Champions League loss in Barcelona.

Jürgen Klinsmann claimed his first win in charge of Hertha Berlin thanks to Vladimir Darida's rocket inside the left post for a 1-0 home victory over high-flying Freiburg.

Darida let fly from outside the penalty area to decide a lackluster game in the 53rd. It was Hertha's first win in six league games.

Cologne defeated nine-man Bayer Leverkusen 2-0 in the Rhine derby and Union Berlin was held to a 1-1 draw at Paderborn.

More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports

Ciarán Fahey on Twitter: https://twitter.com/cfaheyAP