Bundesliga leaders Bayer Leverkusen struck twice in stoppage-time to come from behind and beat 10-man Qarabag 3-2 at the BayArena to reach the quarter-finals of the Europa League.

Xabi Alonso’s side looked set to see their 36-game unbeaten run across all competitions come to an end after goals from Abdellah Zoubir and Juninho either side of a red card for Elvin Cafarguliyev, which was upgraded from a yellow by English referee Anthony Taylor after checking the pitchside monitor.

Jeremie Frimpong started the unlikely comeback with 18 minutes left before Patrik Schick – whose late goal had secured a 2-2 draw from the first leg in Baku – slid home an equaliser and then headed in a dramatic winner deep into stoppage time to secure a 5-4 aggregate victory.

The hosts had made a bright start, with Borja Iglesias heading over and then blazing a shot off target after being played into the right side of the penalty area.

Iglesias remained a lively threat and tested Qarabag keeper Andrey Lunev with an angled drive at the near post.

Leverkusen continued to press, but Amine Adli’s side-foot effort was too central to trouble Lunev in the 17th minute.

Bayer Leverkusen go close to scoring against Qarabag

Qarabag finally created an opening at the other end when Juninho made space for a shot on goal, which was just wide of the right-hand post.

Leverkusen almost made the breakthrough just before half-time when Lunev’s stray pass across the penalty area was headed goalwards by Iglesias to Adli in the six-yard box.

He then nodded the ball back to Florian Wirtz and his shot struck the top-right angle of post and crossbar. The flag, though, went straight up with Adli having been offside.

Leverkusen threatened again soon after the restart as substitute Exequiel Palacios dragged his shot wide from the edge of the penalty area.

Qarabag stunned the hosts when they broke the deadlock in the 58th minute as Zoubir headed in a cross from Leandro Andrade following a counter attack.

The visitors, though, were soon reduced to 10 men.

Cafarguliyev tugged back Jeremie Frimpong, who had sprinted clear down the right flank.

Although initially shown only a yellow card, Taylor was advised by VAR to check the pitchside monitor and following a lengthy review he eventually brought out the red card.

Qarabag, though, struck again in the 67th minute when Juninho swept in a low cross from Marko Vesovic after another swift break.

Frimpong pulled a goal back with 18 minutes left, volleying in at the far post from a deep cross through the penalty area by Alejandro Grimaldo.

Leverkusen, who had also been 2-0 down in the first leg, pushed for an equaliser as Grimaldo shot wide before then curling a 20-yard effort just over.

In the third minute of stoppage time, Schick stabbed the ball past Lunev at the near post from Grimaldo’s low cross.

Just when it looked like Qarabag would hold out to force extra-time, Schick arrived at the far post to nod in Palacios’ cross and send Leverkusen into the last eight.