A powerful header from Barcelona's Yerry Mina fired Colombia into the last 16 of the World Cup with a 1-0 win over Group H rivals Senegal, who crashed out due to a poorer disciplinary record than Japan.
Colombia and Japan will play either England or Belgium, who were playing later Thursday.
The South Americans, looking to reach the latter stages after reaching the quarter-finals in Brazil, risked going out of the tournament at the first hurdle.
But after seeing the video assistant referee come to their rescue in a disappointing first half, Colombia were handed a last-16 lifeline 13 minutes from the end when Mina rose to meet a corner from the right and direct a header into the roof of Khadim Ndiaye's net.
Poland's 1-0 consolation win over Japan meant the Asians finished level with Senegal, who were agonisingly eliminated because they were issued six yellow cards in the competition, two more than Japan.
In Samara, Colombia coach Jose Pekerman kept faith with the attacking front line that thumped Poland 3-0, with midfielders Juan Quintero, James Rodriguez and Juan Cuadrado providing the support for striker Radamel Falcao up front.
But by the end of an entertaining first half, Pekerman was forced to tinker when Rodriguez was forced off with an injury problem and replaced by Luis Muriel.
Before then, Senegal had shown attacking potency but, all too often, failed to threaten David Ospina's goal.
Colombia's best first-half chance came from a free-kick that saw Ndiaye dive to parry Juan Quintero's powerful effort after Falcao had been sandwiched in mid-air.
Yet Colombia lacked pace and punch, and the trickery of Juan Cuadrado, so effective against Poland, failed to impress Senegal as they caught the Juventus man out more than once.
When Cuadrado lost possession cheaply at the halfway line, Keita Balde sent Sadio Mane on his way towards goal before the Liverpool man fell under a challenge from defender Davinson Sanchez.
Serbian referee Milorad Mazic pointed to the spot but amid Colombian protests he was called to consult the VAR, which showed Sanchez's boot had made contact with the ball first.
From another free kick Falcao was flagged offside when he headed Quintero's floated delivery high and wide.
Senegal responded, but Keita shot straight at Ospina after the 'keeper had spilled a powerful drive by Mane.
There was excitement among the Colombian fans when they learned Poland had scored against Japan, but Los Cafeteros struggled to do their bit.
Hopes were raised when Quintero's powerful free kick from the right was blocked in the area and fell to Muriel, whose shot was deflected out. From the corner, Falcao's header was bundled wide.
Penalty claims were waved away when Muriel fell dramatically under a challenge by Ndiaye as the 'keeper rushed out to close him down.
But the Samara stadium erupted as Colombia finally broke the deadlock.
Cuadrado's attempt to dribble into the area earned a corner, and Barcelona defender Mina rose highest to flash a header downwards that bounced up into the top of Ndiaye's net on 77 minutes.
Senegal rallied in the closing minutes and it took a series of great saves by Arsenal shot-stopped Ospina to keep Colombia in the tournament.
Senegal Vs Colombia
Senegal can book their place in the round of sixteen for the second time in their history with a point but will face a tough test against a fired up Colombia side who impressed in their second group game against Poland.
The Lions of Teranga is looking to replicate the heroes of 2002 who went all the way to the quarter-finals in their maiden tournament. Now the West African side are on the cusp of making the knockout stages and need to perform against Colombia. Head coach Aliou Cissé became an overnight meme after his celebration against Poland went viral. The 42-year old was the captain of the side in 2002 and is best placed to advise the side on how to play Colombia in Samara.
Defender Moussa Wague scored in the 2-2 draw to become the first ever African teenager to score at a World Cup. The KAS Eupen right back has shown plenty of energy so far in the tournament, and his pace and composure is going to be a key asset for the side, who will look to take Colombia on the break.
Spirits will be sky high in the Colombia camp following a spectacular 3-0 win against Poland. Now a victory for Los Cafeteros will guarantee a place in the round of sixteen were a match against England or Belgium will await.
In team news, Carlos Sanchez is likely to return to the starting line up after seeing red in the opener against Japan. José Pékerman is likely to stick with the 4-2-3-1 formation which worked to devastating effect against the Poles.
Juan Quintero was one of the key men in the Colombia side last time out, and the Porto player is set to reprise his role in an attacking midfield position. His through balls could be a valuable asset for Colombia who will be looking to exploit the Senegal defence that looked vulnerable in the draw with Japan.
It promises to be a fascinating encounter as Senegal & Colombia face off for a place in the round of sixteen. Watch the Live & Exclusive stream of the game on MAX HD3 & beIN SPORTS CONNECT.