Belgium lost Kevin De Bruyne to injury and faced concerted pressure as the holders, led by the tireless Cristiano Ronaldo, rallied after the break but held on to win 1-0.
The much-hyped encounter largely failed to live up to its billing but Portugal produced a grandstand finish in which Raphael Guerreiro hit the post was their best chance.
Belgium survived the late onslaught to book a quarter-final against Italy.
The first half was a cagey affair with few opportunities and little goal threat until Thorgan Hazard lit up the contest with his moment of quality.
Portugal’s Diogo Jota had an early chance when he was played into the box by Renato Sanches but he screwed a left-foot shot across goal.
Belgium did not have a look at goal until the 20th minute when Thorgan Hazard tried his luck from distance but Diogo Dalot blocked.
Portugal talisman Ronaldo, looking to surpass Ali Daei as the most prolific goalscorer in international football history, lined up a free-kick in the 24th minute but Thibaut Courtois pushed away his swerving effort.
Dalot also had a chance but was flagged offside before volleying wide.
The game appeared to be meandering towards the interval when Thorgan Hazard struck out of the blue to put Belgium ahead.
Romelu Lukaku held the ball up in the box before it was fed to the younger of the two Hazard brothers 20 yards out.
The Borussia Dortmund player connected with a fierce drive which swerved and deceived Rui Patricio.
That changed the complexion of the game and Belgium threatened again moments later and forced Ruben Dias to slice an awkward clearance towards his own goal.
Patricio this time saved comfortably.
Yet just as they were getting on top, Belgium were forced into retreat early in the second half as key player De Bruyne was forced off injured.
The Manchester City playmaker was still feeling the effects of an earlier challenge from Paulinha and looked dejected as he admitted defeat and was replaced by Dries Mertens.
Ronaldo sensed a chance and had a shot blocked before combining with Dalot to create a chance for Jota but the Liverpool forward shot over.
Courtois then saved a header from substitute Joao Felix and Ronaldo hit the wall with another free-kick.
Belgium were seeing less of the ball but Lukaku tried to relieve some pressure with a shot that flew wide from distance.
The game became niggly as time ran down. There were clear signs of Portuguese frustration as Pepe was booked for catching Eden Hazard high with his arm.
The referee had been trying to stop play at the time after Lukaku had gone down with a head injury.
Portugal roused themselves for one last push but Courtois saved from a Dias header and Guerreiro thumped a volley against the base of the post. Felix put their final chance wide.
Belgium advance to the quarter final, leaving reigning champions Portugal out at the first knockout hurdle.