Miguel Veloso's last-gasp header moved Portugal within touching distance of a place in Euro 2016 as they beat Albania 1-0 in Elbasan.
The Dynamo Kiev midfielder connected with a corner from substitute Ricardo Quaresma in the second minute of stoppage time to end the hosts' unbeaten run in Group I.
Cristiano Ronaldo, without a goal for club or country in four games so far this campaign - a relative drought by his extraordinary standards - hit the post from just three yards out early on, and was routinely frustrated by Albania goalkeeper Etrit Berisha.
Fernando Santos' side, beaten by France last week, also squandered a glut of chances after the interval, before Albania hit the woodwork through Sokol Cikalleshi's deflected strike.
Making his first Portugal start in almost a year, Veloso thought he had snatched it for Portugal with 10 minutes remaining, but his deft chip inched just wide of the target.
However, he made amends in the dying moments to extend Portugal's lead at the top of Group I to four points.
Gianni de Biasi named an unchanged Albania line-up to the one that drew 0-0 in Denmark last time out, and Berisha had to be alert from the off to prevent Ronaldo's low drive nestling in the bottom corner.
Ronaldo should have opened the scoring after stealing in unmarked to latch onto the resulting corner, but he could only clip the post with a miscued toe-poke.
Portugal continued to dominate, with Berisha again doing well when he rushed out to beat Ronaldo, deployed in a central role up top, to Veloso's lofted pass.
The Real Madrid star went close with another long-range strike on the half-hour mark, before Bernardo Silva saw a curling effort sail just wide of the left-hand upright.
Berisha was once again called into action shortly after the restart – the Lazio man well positioned to gather in Nani's audacious flick, before Danny could only nod wide from close range.
Albania continued to stifle the visitors, however, though they were unable to carve out any real chances of their own, with Santos introducing Ricardo Quaresma in place of the largely ineffectual Silva.
Albania finally had an effort on target with 15 minutes remaining, Cikalleshi's effort taking a wicked deflection off Pepe and bouncing off of the crossbar.
Berisha was left stranded by Veloso's lob moments later, he could not find the target.
Just as Albania's unbeaten qualification campaign looked as it would go on, Veloso had his goal, rising highest to thunder Quaresma's right-wing corner past a helpless Berisha.