Colombia finished top of Group C to set up a last-16 tie against Uruguay after beating Japan, who were eliminated.
Japan needed a win to stand a chance of progressing but went behind when Juan Cuadrado scored a penalty following Yasuyuki Konno’s foul on Adrian Ramos.
Shinji Okazaki’s steered header drew Japan level only for Jackson Martinez’s low strike to restore Colombia’s lead.
Martinez cut inside and slotted in a left-foot shot before James Rodriguez’s exquisite chip wrapped up the win.
Colombia used their third goal as the signal to bring on 43-year-old keeper Faryd Mondragon, whose introduction saw him become the oldest player at a World Cup finals as he broke Cameroon forward Roger Milla’s record.
Los Cafeteros, who went into the game having already qualified for the knockout stages for the first time since 1990, used the game as an opportunity to rest key players but still registered a third straight win.
Japan manager Alberto Zaccheroni had recalled playmaker Shinji Kagawa in an attacking line-up and, despite Colombia making eight changes, his side quickly found themselves behind.
Konno tripped Ramos and winger Cuadrado, who had assisted three of his side’s five goals in Brazil, drilled in the subsequent spot-kick.
Japan went close when Kagawa sidestepped Eder Balanta and had a low shot turned around the post by keeper David Ospina before Colombia should have extended their lead.
Ramos squared the ball across the box for an unmarked Martinez, only for the striker to side-foot wide.
The miss was punished with Japan equalising on the stroke of half-time. Keisuke Honda crossed and Okazaki produced an accomplished finish with a stooping header low into the corner.
Colombia playmaker Rodriguez came on for his side after the break and had a shot deflected wide, before setting up Martinez to angle in a shot to restore his side’s lead.
Honda had a dipping free-kick fended away by Ospina and Yoshito Okubo blazed high from a low cross as Japan continued to attack.
But Zaccheroni’s team left themselves exposed at the back and Colombia clinically capitalised.
Rodriguez set up Martinez to finish a counter-attack with a smart finish, before the forward turned goalscorer when he jinked past Maya Yoshida and chipped home for his third goal of the tournament.
Colombia coach Jose Pekerman:
“I think what James Rodriguez has done today simply demonstrates what we expected from him.
“From the beginning of this World Cup, he has shown that he is very well physically, is fit and that we can expect a lot from him.”
Japan coach Alberto Zaccheroni:
“I will speak to the management and will let you know whether or not I will stay. I think it is only appropriate for this question to be discussed within the team first.
“I think we left quite a lot to be desired in the first two games. We picked up in the third match. We were forced to play everything against a team that has great potential to go very far in this tournament.
“We all thought we would do a lot better, that we would perform much better as we showed in the first half (against Colombia) when we play intensely as we normally do and we are able to generate opportunities to win a match.”