The African Under-20 championship hosts, Senegal, secured the fourth and remaining 2015 Fifa World Cup place with a dramatic 4-3 win over Congo in their last Group A match.
A goal from Sidy Sarr in the dying seconds gave Senegal their first ever victory in the competition and also helped them progress to the semi-finals of the African championship.
Senegal will join fellow semi-finalists Ghana, Mali and Nigeria at the Under-20 World Cup later this year in New Zealand.
The hosts were under pressure for a victory, having lost their previous two group games. They had suffered a 3-1 defeat to Nigeria and had drawn 2-2 with Ivory Coast.
Now their coach, Joseph Koto, is urging his players to target the trophy itself.
"If we had lost, Senegalese football would have died," Koto told reporters after the match.
"We did not deserve to be out of the competition.
"After achieving our first objective, we will put in all the efforts to make the second - win the trophy."
In Saturday's other group A match, Nigeria - who had already qualified for the last four - drew 2-2 with Ivory Coast,. Nigeria twice came from behind to deny Ivory Coast a World Cup spot and a place in the semi-finals.
In Sunday's final Group B games ,Ghana take on Mali to decide who will top the pool while South Africa face Zambia.