Kalidou Koulibaly sent his country to the knockout stages of the World Cup as he scored the winner against Ecuador.
Ismalia Sarr opened the scoring from the spot for the Africans just before half time.
But Moises Caicedo equalised midway through the second half before Koulibaly put Senegal back ahead two minutes later.
Ecuador and Senegal went into this deciding game in second and third place in Group A respectively. Ecuador were on four points after they started off with a win against hosts Qatar before securing a well-earned draw against Netherlands. Senegal, without star player Sadio Mane, lost 2-0 to the Dutch and then beat Qatar 3-1 to be on three points.
These two sides had met just once before, an international friendly in 2002 in which Senegal won by one goal to nil.
Both nations were still in contention to qualify for the Round of 16 going into this so it meant for a tense contest as both sides knew the ramifications of the result.
Idrissa Gueye had a chance in the first stages but put his shot wide from inside the box.
The first half looked like it was going to end goalless as both sides were tense in possession in a scrappy affair.
However, Senegal were handed a penalty when Hincapie clashed with Sarr in what was a certain foul as he tried to cover. Sarr took the spot kick and converted it, putting Senegal in front.
It was a pivotal time to score just before half time and they went into the break in the lead.
The second half dragged on with Senegal remaining in the lead and adopting a defensive play style in the hope of seeing the game out.
Yet the South Americans did find an equaliser on 68 minutes as Brighton’s Caicedo tapped in at the back post from a corner.
But, just two minutes later, Senegal went back ahead courtesy of skipper Koulibaly. Ecuador did not deal with a free kick, and it fell to the centre-half who calmly finished past Galindez.
And Ecuador were unable to level for a second time in the game as Senegal ran out winners of the game and ultimately progressed, sending Ecuador home.