Edinson Cavani's goal eight minutes from time gave Uruguay a narrow 1-0 win over Chile to ensure they topped Group B of the 2019 Copa America.
There reward is quarter-final against Peru, while two-time defending champions Chile face a much more daunting task to reach the semi-finals when they face Colombia, the only team at the Copa America with a 100 per cent record.
Uruguay demonstrated a winning attitude and mentality, according to Cavani, whose header off a Jonathan Rodriguez was his 48th goal for his country.
"In some moments we played well, in other moments less well, but always with the [right] attitude and mentality we were able to snatch the game," said the 32-year-old Paris Saint-Germain striker.
"We wanted to win the group without knowing what would come next, to show a good image in the group and continue with this attitude."
Chile had appeared on course to top the group stage, having won both of their previous matches, but were unable to find an advantage over Uruguay at the Maracana in Rio de Janeiro.
Chile 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's superior aerial prowess formed the basis of much of their attacks, with Diego Godin heading over from two yards and Martin Caceres unable to direct a Cavani flick-on goal wards.
That route eventually led to the winner though, with substitute Rodriguez chipping a delightful ball into the box for Cavani to plant a header into the corner of Gabriel Arias' goal.
Uruguay's veteran manager Oscar Tabarez said there was little between the two teams and said the extra day's rest afforded to the group leaders before taking on Peru, who finished third in Group A to progress as one of the two best third-placed teams.
Peru will have two extra days to recover from their pool efforts before taking on the 15-time Copa champions on Saturday in Salvador. "One extra day of rest is useful, it's important, because we're on the limit," Tabarez said.
Chile face Colombia on Friday in Sao Paulo for a place in the final four. Manager Reinaldo Rueda, who was greeted to a cacophony of boos and jeers when his name was announced before kick off, said defeat to Uruguay was hard to take.
"We lost, that's tough on the players' motivation," Rueda said. "But we played very well, we showed character, we showed discipline."
Japan and Ecuador both exited the tournament after playing out a 1-1 draw in Belo Horizonte in the group's other match.
It meant Japan missed out on goal difference while Ecuador came up a point short.
With Peru having already qualified as one of the two best third-placed teams, Japan, one of two tournament guests along with Qatar, faced a must-win match in their bid to reach the knockout stages, as did their opponents.
The Asian heavyweights took a 15th-minute lead through Shoya Nakajima following a VAR review before Angel Mena equalised 20 minutes later.
Recalled teenage forward Takefusa Kubo, dubbed the "Japanese Messi", thought he had netted a winner that would have seen Japan through to the quarters, but had his hopes dashed by a VAR review.
Hajime Moriyasu said his team would learn from their Copa America heartbreak.
"They're learning to compete with top level opponents," said Moriyasu, who brought a mostly Under 23 team to Brazil with an eye on next year's Olympic Games to be held in Tokyo.
"Our players need to learn as much as they can, with great humility, respecting their opponents and understanding that they can develop our football."