Ajax eventually wore down a tenacious 10-man Borussia Dortmund team to win 3-1 and book its place in the Champions League knockout stages on Wednesday.

Despite a first-half red card, Dortmund led the game until Dusan Tadic leveled the score for Ajax in the 72nd minute, before goals from Sébastien Haller and Davy Klaassen gave Ajax the win. It's the first time Ajax has gone beyond the Champions League group stage since its surprise run to the semifinals in 2018-19.

Two video reviews shaped the game in less than 10 minutes. The first upheld a contentious red card for Dortmund center-back Mats Hummels over a lunging challenge on Brazilian winger Antony despite relatively light contact. Hummels seemed stunned as he walked off.

Dortmund responded by taking the lead eight minutes later after the VAR system drew the referee's attention to a foul on England midfielder Jude Bellingham by Ajax's Noussair Mazraoui. Captain Marco Reus stepped up to convert the resulting penalty.

READ: UEFA Champions League: Milan draws 1-1 against Porto to keep round of 16 hopes alive

Needing a win to be sure of qualifying, Ajax put Dortmund under pressure throughout the second half and was rewarded when Dusan Tadic scored off an assist from Antony in the 72nd. Haller followed up with a header in the 83rd and Klaassen extended the lead in stoppage time.

Ajax had thrashed Dortmund 4-0 in the first game in Amsterdam last month, but the German team was much more competitive on Wednesday even without striker Erling Haaland, who watched from the stands with a hip muscle injury. Backup Donyell Malen only came on as a substitute after a recent stomach illness as the inexperienced forward Steffen Tigges got his first Champions League start.

Ajax is assured of qualifying with four wins from four games in Group C for a six-point lead over Dortmund and Sporting Lisbon, which beat Besiktas 4-0 in the other game Wednesday.

Pedro Gonçalves scored twice, and Paulinho and Pablo Sarabia added a goal each, as the Portuguese champion comfortably won its seventh in a row in all competitions and stayed within range of the Group C leader. Besiktas was eliminated after its fourth straight loss in the tournament.

Dortmund police said Ajax fans threw bottles at officers ahead of the game and a small number of arrests were made after pyrotechnics were lit in the city center. More investigations are under way.