Rio de Janeiro, Brazil: Japan and Ecuador were left heartbroken as their 1-1 draw in Belo Horizonte on Monday saw them miss out on the Copa America quarter-finals, with Paraguay qualifying instead.
Uruguay, meanwhile, topped Group C as Edinson Cavani's goal eight minutes from time gave them a 1-0 win over champions Chile, who also qualify, at Rio de Janeiro's Maracana stadium.
Japan and Ecuador faced a must win match in their bid to reach the knock-out stages as one of the two best third-placed finishers.
Peru had already secured their spot from Group A while Paraguay, in Group B, were left sweating on Monday's result having finished their campaign on Sunday with two points from three games.
Shoya Nakajima gave Japan the lead on 15 minutes with a goal validated by VAR, but 10 minutes from half time, Angel Mena equalized for Ecuador.
Japan substitute Daizen Maeda was put clean through late on but saw his effort saved by goalkeeper Alexander Dominguez.
Deep into stoppage time teenage sensation Takefusa Kubo had the ball in the net but a dramatic winner was ruled out for offside after consulting VAR.
It meant Japan missed out on goal difference while Ecuador came up a point short.
Paraguay will play hosts Brazil in the first quarter-final on Thursday in Porto Alegre.
Japan coach Hajime Moriyasu had recalled 18-year-old Kubo but it was Nakajima who proved the Blue Samurai's most potent weapon, at one point trying to chip Ecuador's goalkeeper from halfway.
He and Ecuador's Enner Valencia both fired early shots over before Nakajima gave Japan a 15th minute lead with a shot from outside the box.
It was originally disallowed but then validated following a VAR review.
Japan's Eiji Kawashima saved a shot from Valencia but Ecuador were level on 35 minutes after the veteran goalkeeper failed to hold a Robert Arboleda effort, allowing Angel Mena to tuck home the rebound.
Almost immediately, new Real Madrid signing Kubo came to life and forced a save out of Dominguez.
Japan impressed with their pace and team-work in the first half but Ecuador's outfit of strapping, muscular specimens had a clear physical advantage.
Nakajima turned provider for Naomichi Ueda in the second half but Dominguez saved the Japan midfielder's header while Kawashima denied Ayrton Preciado.
Maeda had a chance to win it in the dying moments when put through by Kubo but couldn't beat Dominguez.
And Kubo, nicknamed the "Japanese Messi" saw his hopes of becoming the nation's hero dashed by VAR.
In Rio, Chile knew they needed only a draw to keep hold of top spot in Group C and avoid Colombia -- the only team with a perfect group stage record -- in the quarter-finals.
They took no risks and began with a back three, recalling Gonzalo Jara -- no stranger to Uruguay's forwards.
He was involved in a pair of controversial incidents in 2013, when he touched Luis Suarez's testicles during a match, and two years later when he tried to insert a finger in Cavani's backside.
Chile, playing with greater urgency, were on top for the first 20 minutes with Alexis Sanchez lashing an early shot over the bar and Uruguay goalkeeper Fernando Muslera saving from Charles Aranguiz and Eduardo Vargas.
Uruguay found their feet, though, and Suarez pounced on a defensive mistake to nip around goalkeeper Gabriel Arias, but he was forced wide and the chance was snuffed out.
From the resulting corner Diego Godin headed over from three yards out.
Uruguay looked dangerous from set pieces and Martin Caceres bundled wide after Cavani's flick-on.
At the other end, Jose Gimenez headed the ball off his own line from Paulo Diaz's header.
For a team with nothing to lose, Uruguay had shown little urgency but they took the lead with a moment of quality.
Just six minutes after coming on Jonathan Rodriguez chipped the ball into the box and Cavani planted an unstoppable header into the corner, securing top spot in Group C and a quarter-final date with Peru in Salvador.