The Americans had looked to be safely into the last 16 after second-half goals by Jermaine Jones and Clint Dempsey saw them come back from 1-0 down - a goal by Nani - to lead. (Agencies)
However, with only seconds remaining one sublime cross from a pretty anonymous Ronaldo was met by Varela and it soared past Tim Howard to give Portugal a lifeline as a further defeat after the 4-0 hammering by Germany in the opening game would have seen them out.
The United States - who reached the last 16 in 2010 only to lose to Ghana - are on four points along with Germany, who they play in their final group game, and who their coach Jurgen Klinsmann led at the 2006 finals.
Ghana and Portugal both have one point and play also on Thursday.
The Portuguese got just the start they needed to settle their nerves as a terrible defensive error by Stoke City's Geoff Cameron - the ball flying off his boot to Nani – saw the Manchester United winger wait for Howard to commit himself before rifling the ball into the net.
It had been preempted by an outrageous piece of skill by Ronaldo down the left side, completely bewitching three American players as they tried to corral him out on the touchline, only for a series of step overs and a backheel to see him squirm through the three of them.
The Portuguese's cursed run of injuries continued as veteran striker Helder Postiga - who himself started only because Hugo Almeida had gone off injured early on in the opening game against Germany - lasted just 16 minutes before he had to go off and be replaced by Eder.
The Americans had looked to be safely into the last 16 after second-half goals by Jermaine Jones and Clint Dempsey saw them come back from 1-0 down - a goal by Nani - to lead.