Cristiano Ronaldo scored a late brace to take his tally for Portugal to a record-breaking 111 goals to down the Republic of Ireland.
Ronaldo was the main man as he struck in the 88th and 96th minute to turn the game on its head.
Gavin Bazunu saved the forward’s penalty early on before John Egan headed Ireland in front before the break.
But just as Stephen Kenny dared to believe a first competitive win of his reign at the 10th attempt was coming his way, Ronaldo eclipsed the 109-goal record he shared with Iran’s Ali Daei and then took his tally to 111 to turn the game on its head.
The final score was desperately harsh on Ireland, who have now played three qualifiers and still do not have a point to their name despite their most impressive performance yet under Kenny.
Kenny had asserted in advance that simply defending would be unworkable, but his side found themselves with little option in the early stages and they almost paid for it when Jeff Hendrick was adjudged to have brought down Bruno Fernandes inside the penalty area and referee Matej Jug pointed to the spot.
Having been advised to review the incident at length, the Slovenian stuck to his original decision handing Ronaldo an early chance to pass Daei’s mark, but a superb save by Bazunu as he dived to his right dashed his hopes.
Ronaldo’s miss did little to change the pattern of the game as a star-studded Portugal team conducted by Fernandes probed away with increasing penetration, Diogo Jota heading against a post from Joao Cancelo’s 28th-minute cross with Bazunu helpless and Fernandes curling an effort over with 10 minutes of the half remaining.
In the meantime, Kenny had been forced into a reshuffle by an injury to Dara O’Shea which prompted him to hand a senior debut to Norwich defender Andrew Omobamidele, although the newcomer arrived with the visitors growing into the game and starting to prosper on the counter attack.
They might have taken the lead when Aaron Connolly got in behind the Portugal defence, only to see his attempt blocked by keeper Rui Patricio.
But they did just that on the stroke of half-time when Egan rose ahead of Ronaldo to glance Jamie McGrath’s corner across Patricio and inside the far post.
Ireland returned from the break anticipating an onslaught and they were not to be disappointed, but their impressive organisation remained admirably intact to repel wave after wave with little real difficulty.
Bazunu was sent scrambling anxiously across his goal as Fernandes’ 55th-minute strike arced agonisingly wide of his far post, but the visitors were appealing in vain for a penalty four minutes later with Connolly adamant he had been barged to the ground by Joao Palhinha as he fired wide Egan’s knock-down.
Portugal turned the screw as time ran down and seemed certain to level with 16 minutes remaining when Bernardo Silva collected the ball beyond the far post and stepped inside on to his left foot only to blaze high over.
Bazunu kept out Ronaldo’s 89th-minute free-kick to edge the Republic ever closer to victory, but there was nothing he could do to keep out his header seconds later as he climbed to meet substitute Goncalo Guedes’ cross.
There was to be a further twist, however, and inevitably it was Ronaldo who was on hand to plant home a second header and snatch victory in the sixth minute of stoppage time.