Defending champions Brazil rode their luck to win a tense Copa America group stages match against Colombia on Wednesday.
Despite the defeat, the Colombians will also advance to the knockout stage of the tournament.
The 2-1 scoreline, however, tells little about the match that featured three extraordinary goals.
Colombia opened the scoring in the 10th minute after Juan Cuadrado crossed from the right and found Luis Diaz all alone in the middle of Brazil's penalty box. The striker shot a powerful volley to the right side of goalkeeper Weverton and scored possibly the best goal of the tournament.
Colombia then started defending against a Brazil team that barely stopped surrounding its penalty box on the poor pitch of the Nilton Santos stadium in Rio de Janeiro. It appeared as if Colombia would be able to hold out until Argentine referee Nestor Pitana's knee came into play.
Pitana accidentally blocked a pass by Neymar about 10 meters in front of the Colombian area in the 78th minute. Colombian defenders momentarily stopped, but Brazil substitute Lucas Paquetá just moved the ball to left-back Renan Lodi and his cross found Roberto Firmino, whose angled header beat Colombian goalkeeper David Ospina.
The Colombians initially refused to restart the match but Pitana, the referee of the 2018 World Cup final, confirmed Brazil's goal.
Brazil kept pressuring in the final minutes and found its reward in added time. Neymar took a corner and Casemiro netted the winner.
"They came at us once and then stopped,” Casemiro said after the match. "It was our attack against their defense. Colombia is a strong team but, as the coach requires, we are very strong mentally.”
Colombia coach Reinaldo Rueda said the deflection off Pitana affected his players in the buildup to Brazil's first goal.
"The two Brazil goals are different situations. In the first, I think the referee's decision distracted our players. And in the second we were not paying attention when they took the corner,” he said. "It is a shame, all our effort was lost in a set piece.”
Midfielder Cuadrado agreed, saying "We are very upset about the goal."
"The ball hit the referee and he should not have validated it in the way he did.”
Brazil was already assured of advancing to the knockout stage before the match, but players were effusive in their celebration of the win. Neymar and Colombia's Miguel Borja traded insults after the match ended, and tough challenges from both sides marked the final minutes.
Earlier in the evening, Ecuador and Peru drew 2-2 at the Olimpico stadium in Goiania in the other Group B game. The Ecuadorians opened the scoring with an own goal by Renato Tapia in the 23rd and got their second via Ayrton Preciado in the first-half stoppage time.
Peru pulled level in the second half with goals by Gianluca Lapadula in the 49th and Andre Carrillo in the 54th. Both teams retained their chances of advancing to the knockout stage.
Brazil leads the group with nine points after three matches. Colombia has four from four matches, but it is sure to advance because Peru and Venezuela will meet on the weekend - and only one of those teams can overtake the Colombians in the group.
Peru has four points followed by Ecuador (3) and Venezuela(2). The top four teams advance to the playoff stage.
Brazil will play its last group stage match against Ecuador on Sunday.