Having seen a two-goal lead evaporate on a brace from Denmark forward Nicklas Bendtner, Varela’s right-footed strike in the 87th minute lifted the Portuguese to a 3-2 win in Group B and pulled Portugal (three points) even with Denmark (three points) and, at least temporarily, Germany, in Group B.
Germany can seal a spot in the knockout round with a win over Holland in the second game of the day.
Denmark needed a win to secure advancement from the group stage, but it was Portugal that seized control early on Wednesday, scoring twice in a 12-minute span in the first half to take the early lead.
Portugal opened the scoring in the 24th minute when Cristiano Ronaldo’s corner kick met defender Pepe outside of the six-yard box on a near-post run. The defender flicked a powerful header over his shoulder inside the near post for a 1-0 lead.
The lead doubled in the 36th minute on a fine build up from the Portuguese. A cross from the left side was knocked down and dropped back onto the foot of Nani. His low cross across the box was hammered into the upper right side of the net by Helder Postiga to make it 2-0.
Denmark, which defeated Holland, 1-0, in its opening game, pulled one back in the 41st minute on a finish by Bendtner, the Arsenal striker who easily headed home a finish after Michael Krohn-Dehli sent a header across the front of an empty net for his teammate to put away.
The 24-year-old forward pulled his country back from the deficit with a snapped header at the far post in the 80th minute to make the score 2-2.
But Varela’s low right-footed blast provided the final margin, and Portugal, which lost 1-0 to Germany in its opener, is now in the mix to advance out of the vaunted Group B.