Casemiro scored deep into stoppage time to give hosts Brazil a controversial win over Colombia in the Copa America.
An acrobatic volley by Luis Diaz gave Colombia an early lead in their final Group B game in Rio de Janeiro.
Roberto Firmino’s late equaliser was allowed to stand despite the ball hitting the referee moments earlier, sparking lengthy protests by Colombia.
And in the 10th minute of added time, Casemiro headed in from a Neymar corner to maintain Brazil’s 100% record.
Brazil were struggling to draw level when Neymar’s wayward pass forward struck Nestor Pitana, who took charge of the 2018 World Cup final.
The Argentine referee put his whistle to his mouth but allowed play to continue once Lucas Paqueta had played the ball wide to Renan Lodi, whose first-time cross was headed in by Liverpool forward Firmino.
There was a lengthy stoppage as Colombia players remonstrated with Pitana, before and after the video assistant referee let the goal stand.
The rules state that if the ball touches the referee and goes directly into the goal, results in a change of possession or a promising attack, a dropped ball should be awarded.
Neymar’s pass would have been intercepted by a Colombia player had it not struck the referee, yet six seconds later the ball was in their goal.
“It’s sad that with all the effort we made against one of the best teams in the world, we lost the match on a call like that,” said Colombia winger Juan Cuadrado, who crossed for Diaz’s stunning opener.
“A referee with that much international experience, who’s refereed at the World Cup, makes a mistake and hurts the match. We never got past that play.”
Despite the defeat, Colombia will still progress into the quarter-finals along with Brazil, who stretched their winning run to 10 games and have already qualified as group winners.
The hosts play their final group game against Ecuador in Goiania on Sunday (22:00 BST).