Mali battled to a draw against Uruguay on Saturday to ensure both teams went through to the final 16 of the Fifa Under-20 World Cup in New Zealand.
Mali and Uruguay drew 1-1 to finish joint second in Group D with identical points and goal tallies.
After a drawing of lots to separate the two, Uruguay were awarded second place with Mali going through as one of the best third-placed teams
Also through are Senegal after a nerve-wracking 24 hour wait.
Senegal had kept their hopes alive with a 2-1 win over Qatar in Group C on Saturday, but only found out they had advanced on Sunday after Germany knocked Honduras out of the tournament with a 5-1 result.
With so much at stake, the match between Mali and Uruguay was always going to be tight, and Uruguay scored first through a delicate first half goal from Franco Acosta who, with his back to the net, deflected the ball past the goalkeeper.
Mali levelled just before the break with an Adama Traore free-kick that found the bottom corner of the net and set up an uneventful second half with both sides playing not to lose rather than to win.
All four sides in Group D had started the final pool round locked on three points with Serbia coming through with a 2-0 win over Mexico to earn top spot and send the Central Americans home.
Colombia, who lost 3-1 to Group C leaders Portugal, sneaked into the last 16 on goal difference ahead of Senegal who have a nerve-wracking wait to see if they too will be among the best third-placed teams.
Senegal came from a goal down after a lethargic first half to beat Qatar 2-1 to give themselves hope of advancing.
Qatar's Akram Afif converted a penalty in the 17th minute after Almoez Ali was brought down. Stand-in Senegal captain Alassane Sylla equalised in the 76th minute and Moussa Kone, after threatening on several occasions, scored the winner five minutes later.
Senegal needed another goal to have a chance of ousting Colombia from second place and almost scored but Mamadou Ndiaye's long-range shot went just wide of the post.
"It was a very difficult match,'' Senegal coach Joseph Koto told reporters.
"Both teams wanted to win and a draw was no good for either side.
"Before the game we knew that even by taking three points it'd very difficult to qualify, so we handled the situation we were in very well.
"The penalty gave us a big shock and we tried to level the game too quickly, which is not the way we should have gone about it."