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.
The South Americans, who reached the quarter-finals in Brazil four years ago, 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 about a quarter of an hour 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.
It was Mina who ended Colombia's growing frustrations when he opened the scoring against Poland in their previous match and coach Jose Pekerman said his second World Cup goal had been no coincidence.
"We played the set piece corner very well. It wasn't a coincidence," said Pekerman. "We have excellent players who can play with their feet but also in the air."
Poland's 1-0 consolation win over Japan in Volgograd meant the Asians finished level with Senegal, who were agonizingly eliminated because they collected six yellow cards in the competition, two more than Japan.
Senegal coach Aliou Cisse was gracious in defeat, saying: "It's the rules of the game. They've been established by FIFA and we have to respect it, even though we would have liked to have been eliminated another way."
In Samara, Pekerman kept faith with the attacking front line that helped thump Poland 3-0, with Juan Quintero, James Rodriguez and Juan Cuadrado providing the support for striker Radamel Falcao.
But half an hour into an entertaining first half, Pekerman was forced to tinker when Rodriguez was forced off with an injury 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 Quintero's powerful effort after Falcao had been sandwiched in mid-air.
Yet Colombia lacked pace and punch, and the trickery of Cuadrado, so effective against Poland, failed to trouble Senegal as they caught the Juventus man out more than once.
When Cuadrado lost possession cheaply on 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 opted to consult the VAR, which showed Sanchez's boot had made contact with the ball first.