Leverkusen were playing their first match since manager Xabi Alonso (centre) announced he will stay at the club next season

Bayer Leverkusen produced a dramatic comeback to avoid their first defeat of the season and claim a 2-1 win over Hoffenheim in the German Bundesliga.

Leverkusen’s 38-game unbeaten streak looked set to end when they found themselves 1-0 down with fewer than five minutes of normal time remaining.

Robert Andrich scored for the league leaders in the 88th minute to cancel out Maximilian Beier’s opener.

The hosts’ comeback was completed with a 91st-minute Patrik Schick winner.

They are 13 points clear of Bayern Munich, who play Borussia Dortmund later on Saturday.

Leverkusen were playing in their first match since manager Xabi Alonso revealed he will stay at the club next season, ending speculation he would join Liverpool or Bayern Munich.

Seventh-placed Hoffenheim stifled the good feeling surrounding Alonso’s announcement when Beier linked up with Wout Weghorst in the penalty area before slotting past keeper Lukas Hradecky.

Leverkusen piled on the pressure and two goals in quick succession from Andrich and Schick ensured the club stretched their unbeaten record to 39 games across all competitions.

Leverkusen are on course to claim their first league title with just seven games left to go this season.