But it proved a story of heartbreak for Club colleague Riyad Mahrez as a 124th minute goal from Cameroon condemned Algeria to a dramatic 2-1 defeat in their African World Cup play-off decider and a 2-2 aggregate loss on away goals.
A brace from Manchester United’s Bruno Fernandes, who struck in both halves, proved decisive and was enough to send Portugal through to the Qatar showpiece in front of a full house in Porto.
After what had proved a tense opening half hour, the hosts made the all-important breakthrough on 32 minutes.
Fernandes cut out a poor crossfield ball by Stefan Ristovski before finding United colleague Cristiano Ronaldo with a first-time pass.
Ronaldo fed the ball back to Fernandes through a defender's legs and Fernandes made no mistake from the edge of the box.
Cancelo almost doubled the Portuguese lead just before the half-time break, seeing a fizzing 20-yard shot just go over the bar.
Fernandes then wasted a gilt-edged chance to double his and Portugal’s tally early after the restart when he could only first straight at the North Macedonia keeper after some suspect defending.
However, the United man made no such mistake on 65 minutes as he did double his tally to all but seal the hosts’ ticket to Qatar.
With North Macedonia pressing forward, Pepe won possession on the edge of his box with Fernandes getting the move going.
Diogo Jota lifted a diagonal ball into the box and Fernandes was on hand to volley in from the penalty spot and seal the deal for Fernando Santos’s side.
However there was a shattering finale for Mahrez and his Algerian side as they lost out 2-1 to Cameroon in Blida after conceding an equaliser in the 124th minute of extra time.
Holding a 1-0 advantage from last week’s first leg, the Desert Foxes had been stunned when Cameroon struck on 21 minutes to level affairs.
Karl Toko Ekambi hit a corner-kick that Algerian goalkeeper M'Bolhi fumbled and Eric Maxim Choupo-Moting was there to clean up the rebound and sweep the ball into the net.
With Mahrez probing at every opportunity, the Algerians sought to reassert control and had an Islam Slimani effort ruled out for offside as the game went into extra time.
Slimani then found the target again on 98 minutes only for VAR to overrule the effort for handball while Cameroon keeper Andre Onana proved an inspired figure all evening, producing a host of key saves.
But, with penalties looming, the Desert Foxes struck with two minutes of extra time left to seemingly book their ticket to Qatar.
Rachid Ghezzal sent in a corner and the unmarked Ahmed Touba headed home from six yards out at the back post to seal a 1-1 draw on the night and 2-1 aggregate victory.
However, there was to be a dramatic sting in the tale as Collins Fai sent in a free-kick and Karl Toko Ekambi latches on to Michael Ngadeu's header to score past Rais M'Bolhi.
It sealed a 2-1 win on the night for Cameroon with the aggregate score level at 2-2 and the visitors reaching the finals on the away goals rule as Algeria suffered a first-ever loss in Blida.
Thomas Muller gave Germany the lead in first half injury time, but Steven Bergwijn’s 68th minute effort ensured it finished honours even in Amsterdam.
Alvaro Morata and Pablo Sarabia both claimed a brace apiece with Yeremy Pino also on target.
City midfielder Rodrigo was an unused substitute.