Hosts Brazil were forced to dig deep against South American rivals Chile, as they booked their place in the FIFA Under-17 World Cup quarter-finals.
Kaio Jorge gave Brazil the dream start at Estadio Bezerrão in Brasilia with an eighth-minute strike, only for Chile to level through Joan Cruz on 25 minutes.
Cruz turned the game on its head by putting the Chileans 2-1 up on 41 minutes, before Jorge grabbed his and Brazil's second on the stroke of halftime, converting a penalty to take the sides in level at 2-2.
The hosts were the better side after the break and Diego's 65th-minute winner was to prove the difference as Brazil advanced to the last eight.
Ecuador or Italy await on Monday (November 11), with the sides scheduled to contest their last-16 match tomorrow.
Spain held off a late Senegal fightback to book a quarter-final match against France.
The 2017 runners-up forged a 2-0 lead courtesy of Roberto Navarro and German Valera goals either side of the break.
Souleymane Faye made it a nervous final five minutes for Spain when converting beyond Ivan Martinez in the 85th minute, but Spain remain on course for a second consecutive FIFA Under-17 World Cup final.
France eased to a 4-0 win against 10-man Australia at Estadio da Serrinha in Goiania.
Nathanael Mbuku gave the French a sixth-minute lead, and when Anton Mlinaric was dismissed for a reckless challenge on Lucien Agoume, the French mission was made easier.
Mbuku added two goals in an eight-minute spell to put the game beyond Australia at 3-0, before an Enzo Millot strike in the 87th minute completed a comfortable victory.
In Brasilia, Eugenio Pizzuto and Santiago Munoz sent Mexico through to the last eight by dispatching Japan.
Pizzuto broke the deadlock in the 57th minute before Munoz sealed the victory 16 minutes from time as Mexico set up a quarter-final against South Korea.
The final last-16 matches will take place tomorrow as Paraguay meet Argentina and Italy take on Ecuador.