Fernando Santos' men looked set to drop points yet again in their quest to reach Euro 2016, until the Real Madrid forward headed home in the final minute of added time.
Cristiano Ronaldo's 95th-minute header earned Portugal a dramatic 1-0 Group I Euro 2016 qualifying win in Denmark on Tuesday.
Last year's Ballon d'Or winner out-jumped Simon Kjaer to nod in substitute Ricardo Quaresma's cross and give Fernando Santos his first victory as Portugal coach.
Ronaldo had been below-par throughout the Copenhagen clash, perhaps due to a knee niggle that he carried into the contest.
But he showed his star quality with a last-gasp winner that will significantly raise the Portugal spirits that were dented by a 1-0 home loss to Albania in their first qualifier last month.
Portugal were the better side in the first half, but Michael Krohn-Dehli came closest to scoring, with the Denmark attacker striking the post from distance.
Denmark defender Nicolai Boilesen had to be taken off on a stretcher in the second half after an errant clearance from team-mate Daniel Agger struck him flush on the side of his head and appeared to knock him out.
And there was further pain for Denmark as Ronaldo's late goal - his 18th of the season for club and country and 51st at international level - saw them lose for the first time in their qualifying campaign.
Portugal coach Santos took his place on the bench after being granted an appeal hearing by the Court of Arbitration for Sport that temporarily lifted his eight-match reprimand for abusing match officials at this year's World Cup.
Santos, then in charge of Greece, will have liked what he saw early as Portugal kept Denmark goalkeeper Kasper Schmeichel busy.
Ronaldo was first to test him in the seventh minute, stinging the palms of the Leicester City man, before Portugal's talisman almost turned provider in a neat one-two with Danny.
Danny shot straight at Schmeichel, though, and Ronaldo then screwed wide from an acute angle in the 17th minute.
Denmark had appeals for a spot-kick turned down, despite Eliseu appearing to handle the ball in his own penalty area, while at the other end, Nani spurned three chances in six minutes - the best of which saw him head Ronaldo's firm cross over from close range.
The hosts nearly took the lead completely against the run of play, when in the 34th minute, Krohn-Dehli curled onto the right-hand post - with goalkeeper Rui Patricio beaten - from the edge of the penalty area.
Ronaldo should have given Portugal the lead in the 51st minute after Danny unselfishly squared to him.
But the Portugal star took a heavy first touch and then shot into the onrushing Schmeichel.
After play resumed following Boilesen's substitution, Krohn-Dehli shot wide for the hosts from the edge of the area.
Both sides struggled for rhythm in the second half and Ronaldo showed his frustration with a late challenge on Pierre Hojbjerg that earned him a yellow card in stoppage time.
Ronaldo's anger quickly turned to joy, though, as he nodded in from four yards to have the last laugh in the Danish capital.
Latest Stories
-
Alan promises to amend the Constitution to limit presidential powers
1 min -
Ghana to face liquidity pressures in 2025, 2026 despite restructuring most of its debt – Fitch
4 mins -
NPP’s record of delivering on promises is unmatched – Bawumia
5 mins -
Mahama: It’s time to dismiss the incompetent NPP government
7 mins -
Today’s front pages: Monday, November 25, 2024
21 mins -
T-bill auction: Government misses target again; interest rates continue to rise
23 mins -
We have a bad technical team; Otto Addo and his team should go – Ernest Thompson
2 hours -
Hindsight: Why Accra Lions’ present problems do not define them
2 hours -
10-year-old Lisa Laryea arrives at Wits Donald Gordon Hospital in South Africa for bone marrow transplant
2 hours -
23 ambassadors inducted to take on 2025 GSTEP Challenge in three regions
3 hours -
Ghana Shea Workers Union inaugurated
3 hours -
Microsoft 365 under attack – how to bulletproof your business against cyber threats
3 hours -
I trust Bawumia; he has never lied to me – Akufo-Addo
3 hours -
Bawumia is hardworking; offers the youth platform to share ideas – Kow Essuman
3 hours -
IGP, Police commanders worship with churches in Ghana as part of security arrangements for 2024 elections
3 hours