MADRID (AP)Getting a penalty after the final whistle had blown wasn’t enough to keep Atletico Madrid in the Champions League.

Yannick Carrasco missed a spot kick that was awarded following a VAR check after the referee had already signaled the game was over, which meant the Spanish club was eliminated following a frantic ending to a 2-2 draw with Bayer Leverkusen on Wednesday.

The referee blew his whistle after Leverkusen defended a corner but Atletico’s players appealed furiously for a handball. A video review showed the ball had been deflected into two Leverkusen players’ arms in the crowded penalty area. A spot kick was given for handball against one of them, Piero Hincapie, but Leverkusen goalkeeper Lukas Hradecky saved Carrasco’s effort it before Atletico’s Saul Niguez crashed a header against the crossbar on the rebound. Reinildo tried to score at the third attempt but the ball hit one of his own teammates and deflected out of play.

Atletico players seemed to argue that Hradecky had left his line early and the penalty should be retaken, but those appeals were brushed aside. A replay showed Hradecky’s back foot was on the line when the ball was struck.

Atletico twice recovered from a goal down against Leverkusen but needed to win to avoid its first group-stage exit in five years.

Leverkusen was eliminated before kickoff when Porto beat Club Brugge in the early game but looked unaffected as first Moussa Diaby and then Callum Hudson-Odoi scored first-half goals to finish off slick team moves.

Atletico responded to Diaby’s goal with one from Yannick Carrasco, assisted by Antoine Griezmann, before Rodrigo de Paul’s spectacular curling equalizer early in the second half made it 2-2. Leverkusen was keen to waste time but nearly won the game on the counter, foiled only by lightning reaction saves from Atletico goalkeeper Jan Oblak.

At the other end, Leverkusen stayed in the contest thanks to smart goalkeeping from Hradecky as the Finland international finished with nine saves including his penalty stop.

It was one of the best performances of a disastrous season for Leverkusen, which is floundering in 15th in the 18-team Bundesliga. The draw leaves Leverkusen coach Xabi Alonso, twice a Champions League winner as a player, without a win in the four games since Leverkusen beat Schalke on his debut.

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP-Sports