AC Milan reached the Europa League group stage after a nervy 9-8 penalty shootout win over Portuguese club Rio Ave on Thursday, having netted a fortunate last-gasp equalizer in extra time.

Milan trailed 2-1 in extra time until Toni Borevkovic gave away a penalty in the 121st minute with a careless handball, allowing Hakan Calhanoglu to level from the spot. Rio Ave then had three chances to win the penalty shootout but missed each time, before Milan goalkeeper Gianluigi Donnarumma made the decisive save to send his team through.

More Images
Tottenham's Harry Kane, center, shoots to score his third goal during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

AC Milan reached the Europa League group stage after a nervy 9-8 penalty shootout win over Portuguese club Rio Ave on Thursday, having netted a fortunate last-gasp equalizer in extra time.

Tottenham's Harry Kane, celebrates with teammates after scoring during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

Tottenham had no such troubles as Harry Kane scored his first hat trick of the season in a 7-2 win over Maccabi Haifa.

Tottenham's Harry Kane, center, shoots to score a penalty kick during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

In the shootout, Nelson Monte first had a chance to win it for Rio Ave with the score at 7-7, but his penalty hit the left post and then rolled across the goalline before hitting the other post and going out.

Tottenham's Harry Kane, right celebrates with teammates after their team won a penalty kick, during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

Kane opened the scoring after just two minutes from close range, and added two more in the second half. Giovani Lo Celso netted two goals in the span of three first-half minutes and Lucas Moura added one for Tottenham before the break. Dele Alli finished off the rout from the penalty spot in injury time.

Rio Ave's Francisco Geraldes, foreground left, scores his side's first goal past AC Milan goalkeeper Gianluigi Donnarumma, center, during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Serbia’s Red Star Belgrade advanced by beating Ararat-Armenia 2-1 in Nicosia. The game was moved by UEFA from Armenia’s capital of Yerevan to neutral Cyprus amid the country’s escalating conflict with neighboring Azerbaijan over over the disputed region of Nagorno-Karabakh.

Rio Ave's Gelson, center, celebrates after scoring his side's second goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Forward Odsonne Édouard netted the lone goal for Celtic at Sarajevo while Rangers knocked out Turkey’s Galatasaray 2-1 at Ibrox Stadium.

Rio Ave's Francisco Geraldes, left, celebrates after scoring his side's first goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

The 48-team draw for the group stage is scheduled for Friday.

Rangers' manager Steven Gerrard celebrates victory at the end of the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' manager Steven Gerrard celebrates victory at the end of the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' Scott Arfield celebrates scoring his side's first goal during the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' Scott Arfield celebrates scoring his side's first goal during the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Sarajevo's Amer Dupovac, left, tries to block a shot from Celtic's Jeremie Frimpong during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Sarajevo's Amer Dupovac, left, tries to block a shot from Celtic's Jeremie Frimpong during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Celtic's Hatem Elhamed, left, duels for the ball with Sarajevo's Selmir Pidro during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Celtic's Hatem Elhamed, left, duels for the ball with Sarajevo's Selmir Pidro during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Granada's Yangel Herrera celebrates his goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granada's Yangel Herrera celebrates his goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granadas's Antonio Puertas, right, scores a goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granadas's Antonio Puertas, right, scores a goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Orges Padula, left, from Basel, and Ali Sowe, right, from Sofia at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Orges Padula, left, from Basel, and Ali Sowe, right, from Sofia at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Arthur Cabral, centre, from Basel reacts after his penalty goal at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Arthur Cabral, centre, from Basel reacts after his penalty goal at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Wolfsburg's Bartosz Bialek reacts after the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

Wolfsburg's Bartosz Bialek reacts after the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

AEK's Karim Ansarifard scores his side's second goal during the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

AEK's Karim Ansarifard scores his side's second goal during the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

The shootout featured 24 penalties in total, with both goalkeepers sending their efforts over the bar.

Tottenham's Harry Kane, center, shoots to score his third goal during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

Tottenham's Harry Kane, center, shoots to score his third goal during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

Tottenham had no such troubles as Harry Kane scored his first hat trick of the season in a 7-2 win over Maccabi Haifa.

However, last year’s quarterfinalist Basel and German club Wolfsburg were both eliminated.

Rio Ave also looked set to spring an upset after Gelson gave the Portuguese club the lead in extra time. However, Borevkovic inexplicably downed a high ball into the area with his hand to give away a penalty with just seconds left — getting his second yellow card in the process.

Tottenham's Harry Kane, celebrates with teammates after scoring during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

Tottenham's Harry Kane, celebrates with teammates after scoring during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

In the shootout, Nelson Monte first had a chance to win it for Rio Ave with the score at 7-7, but his penalty hit the left post and then rolled across the goalline before hitting the other post and going out.

After Donnarumma sent his penalty over the bar at 8-8, his counterpart Pawel Kieszek did the same. And when Chico Geraldes was given a third chance to win it for the Portuguese side, his effort hit the right post.

Tottenham's win came exactly a year to the day after losing 7-2 to Bayern Munich at home in the Champions League group stage

Tottenham's Harry Kane, center, shoots to score a penalty kick during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

Tottenham's Harry Kane, center, shoots to score a penalty kick during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. (Clive RosePool via AP)

Kane opened the scoring after just two minutes from close range, and added two more in the second half. Giovani Lo Celso netted two goals in the span of three first-half minutes and Lucas Moura added one for Tottenham before the break. Dele Alli finished off the rout from the penalty spot in injury time.

Tjaronn Chery and Nikita Rukavytsya scored for Haifa.

The single-leg qualifying games have been played in empty stadiums and on a tight schedule in the pandemic-delayed season.

Tottenham's Harry Kane, right celebrates with teammates after their team won a penalty kick, during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

Tottenham's Harry Kane, right celebrates with teammates after their team won a penalty kick, during a Europa League soccer match between Tottenham Hotspur and Maccabi Haifa in London, Thursday, Oct. 1, 2020. Kane went on to shoot the penalty kick to score.(Clive RosePool via AP)

Serbia’s Red Star Belgrade advanced by beating Ararat-Armenia 2-1 in Nicosia. The game was moved by UEFA from Armenia’s capital of Yerevan to neutral Cyprus amid the country’s escalating conflict with neighboring Azerbaijan over over the disputed region of Nagorno-Karabakh.

Azerbaijan’s Qarabag qualified after a 3-0 away win at Legia in Poland.

Scottish powerhouses Celtic and Rangers both secured a place in Europa League for third straight season.

Rio Ave's Francisco Geraldes, foreground left, scores his side's first goal past AC Milan goalkeeper Gianluigi Donnarumma, center, during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Rio Ave's Francisco Geraldes, foreground left, scores his side's first goal past AC Milan goalkeeper Gianluigi Donnarumma, center, during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Forward Odsonne Édouard netted the lone goal for Celtic at Sarajevo while Rangers knocked out Turkey’s Galatasaray 2-1 at Ibrox Stadium.

Basel was upset 3-1 at home by CSKA-Sofia, while Wolfsburg lost 2-1 at Greece's AEK.

Spain’s Granada, Switzerland’s Young Boys, Dutch side PSV Eindhoven, Croatia's Dinamo Zagreb, Belgium’s Standard Liege, Ireland’s Dundalk and Poland's Lech were also among the 21 clubs to qualify from the playoffs.

Rio Ave's Gelson, center, celebrates after scoring his side's second goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Rio Ave's Gelson, center, celebrates after scoring his side's second goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

The 48-team draw for the group stage is scheduled for Friday.

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

Rio Ave's Francisco Geraldes, left, celebrates after scoring his side's first goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Rio Ave's Francisco Geraldes, left, celebrates after scoring his side's first goal during the Europa League playoff soccer match between Rio Ave FC and AC Milan in Vila do Conde, Portugal, Thursday, Oct. 1, 2020. (AP PhotoLuis Vieira)

Rangers' manager Steven Gerrard celebrates victory at the end of the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' manager Steven Gerrard celebrates victory at the end of the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' Scott Arfield celebrates scoring his side's first goal during the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Rangers' Scott Arfield celebrates scoring his side's first goal during the Europa League qualifying play-off soccer match between Rangers and Galatasaray at Ibrox Stadium, in Glasgow, Scotland, Thursday, Oct. 1, 2020. (Ian MacNicolPool via AP)

Sarajevo's Amer Dupovac, left, tries to block a shot from Celtic's Jeremie Frimpong during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Sarajevo's Amer Dupovac, left, tries to block a shot from Celtic's Jeremie Frimpong during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Celtic's Hatem Elhamed, left, duels for the ball with Sarajevo's Selmir Pidro during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Celtic's Hatem Elhamed, left, duels for the ball with Sarajevo's Selmir Pidro during the Europa League soccer match between Sarajevo and Celtic at the Bilino polje stadium in Zenica, Bosnia, Thursday, Oct. 1, 2020. (AP PhotoKemal Softic)

Granada's Yangel Herrera celebrates his goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granada's Yangel Herrera celebrates his goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granadas's Antonio Puertas, right, scores a goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Granadas's Antonio Puertas, right, scores a goal, during the Europa League play-off soccer match between Malmo FF and Granada CF at Malmo New Stadium in Malmo, Sweden, Thursday, Oct. 1, 2020. (Andreas HillergrenTT News Agency via AP)

Orges Padula, left, from Basel, and Ali Sowe, right, from Sofia at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Orges Padula, left, from Basel, and Ali Sowe, right, from Sofia at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Arthur Cabral, centre, from Basel reacts after his penalty goal at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Arthur Cabral, centre, from Basel reacts after his penalty goal at the Europa League Qualification between the FC Basel of Switzerland and CSKA Sofia of Bulgaria in the St. Jakob Park Stadium in Basel, Switzerland, Thursday, Oct. 1, 2020. (Urs FlueelerKeystone via AP)

Wolfsburg's Bartosz Bialek reacts after the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

Wolfsburg's Bartosz Bialek reacts after the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

AEK's Karim Ansarifard scores his side's second goal during the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)

AEK's Karim Ansarifard scores his side's second goal during the Europa League playoff soccer match between AEK Athens and VfL Wolfsburg at the Olympic stadium in Athens, Thursday, Oct. 1, 2020. AEK Athens won 2-1. (AP PhotoThanassis Stavrakis)