Portugal crushed Armenia 9-1 without suspended talisman Cristiano Ronaldo to clinch qualification for the 2026 World Cup finals on Sunday.
Manchester United's Bruno Fernandes and Paris Saint-Germain's Joao Neves both scored hat-tricks as Roberto Martinez's side racked up a huge win in Porto to top Group F.
Renato Veiga got the ball rolling for Portugal, with Goncalo Ramos and Francisco Conceicao also on the scoresheet.
After a draw in Hungary in October and a surprise defeat at Ireland on Thursday in which Ronaldo was sent off, Portugal wrapped up qualification at the third attempt in their final group match.
They will compete in a seventh consecutive edition of the World Cup, a tournament which the Euro 2016 champions are yet to win.
With Fernandes playing a key role throughout, Portugal made a quick start by scoring in the seventh minute.
Fernandes's vicious inswinging free-kick from just outside the left side of the box was pushed onto the post by goalkeeper Henri Avagyan but Veiga was on hand to head home the rebound.
The visitors shocked the hosts by scoring on their first attack to equalise, with Grant-Leon Ranos crossing for Armenia captain Eduard Spertsyan to strike.
However Portugal quickly stepped up a gear and racked up an unassailable lead. Paris Saint-Germain striker Ramos intercepted a back pass and squeezed home his country's second after rounding Avagyan.
Fernandes completed his hat-trick from the penalty spot after debutant substitute Carlos Forbs was felled.
Neves followed suit for Portugal's eighth goal, smashing home after Veiga headed Fernandes's cross into his path.
Ireland stunned Hungary with a late winner to triumph 3-2 in the other Group F match and reach the play-offs.