DHAKA: 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, reports goal.com.
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.
BDST: 0855 HRS, OCT 15, 2014