Atletico Madrid reached the last 16 of the Champions League after beating Porto in an extraordinary match that saw three players shown red cards.
Antoine Griezmann scored one goal in Portugal and had a key role in the two others as the Spanish side finished second in Group B behind Liverpool.
Atletico led 1-0 through Griezmann when Yannick Carrasco was sent off, before Porto's Wendell saw red.
Porto's Agustin Marchesin, who was not on the pitch, was also shown a red.
Substitute Angel Correa made it 2-0 to Atletico in the 90th minute, while Rodrigo de Paul added a third goal 60 seconds later.
Porto then earned a consolation penalty which Sergio Oliveira converted with the final kick of the game.
Diego Simeone's Atletico began the game bottom of the group but ended it second on seven points, Porto coming third with five and qualifying for the Europa League.
Liverpool finished top with 18 points after winning 2-1 at AC Milan, who finished bottom with four.
Atletico Madrid's Antoine Griezmann: "This match and this group stage campaign sums up just what Atletico is all about. We are a true group and we need everyone to do their bit to get to where we want to. We never stop believing."