The U.S. came within seconds of booking their place in the round of 16 of the 2014 World Cup after Varela scored just before the final whistle to snatch a 2-2 draw for Portugal in Manaus.
Nani had opened the scoring early on only for Jermaine Jones to net a stunner in the second half, before Clint Dempsey bundled home with nine minutes of normal time remaining to seemingly secure his nation's progression from Group G -- but Varela netted in injury time to keep Portugal's qualification hopes alive.
Portugal took the lead after just five minutes when Geoff Cameron's wild clearance fell to Nani at the back post, allowing the winger to thump the ball past goalkeeper Tim Howard.
The U.S. responded well to going behind, as Clint Dempsey curled a free kick over the bar and then saw a shot from an acute angle saved by Portugal's Beto.
Michael Bradley also tried his luck from range but the effort rose off target before Fabian Johnson swerved an effort wide of the post.
Portugal came close to doubling their lead before half-time when Nani's shot was pushed onto the post and then substitute Eder's rebound was acrobatically palmed over by keeper Tim Howard.
USA continued to press in the second half and Michael Bradley was denied an equaliser in the 55th minute when his goal-bound shot was superbly cleared off the line by Ricardo Costa.
Cristiano Ronaldo then spurned a chance to make it 2-0 as he fired wide following a counter-attack, and Jones made him pay for his miss when on 64 minutes he curled in a stunning strike that left Beto rooted to the spot.
With nine minutes left on the clock Dempsey looked to have won it for USA as he turned in Graham Zusi's cross from close range into an empty net with Portugal's backline all at sea, but deep into stoppage time Varela headed in Ronaldo's cross to salvage a point.
Divock Origi scored an 88th-minute winner to secure Belgium's place in the knockout stages of the 2014 World Cup as the Red Devils beat Russia 1-0 at the Maracana.
The Belgians are now on six points in Group H after their opening game defeat of Algeria, while Russia remain on one point following their 1-1 result with South Korea.
The majority of Belgium's attacks in the first half came down the right through Dries Mertens, but the forward failed to test goalkeeper Igor Akinfeev, who was in the Russia side after his high-profile error against South Korea.
Russia enjoyed the better of the chances in the opening 45 minutes, with Thibaut Courtois parrying away a Victor Fayzulin effort and Aleksandr Kokorin flashing a header wide when he should arguably have done better.
It was not until the final 10 minutes of the second half that the game opened up, as Russia's Andrey Eshchenko dragged a shot wide and Belgium substitute Kevin Mirallas thumped a low free kick against the post.
But, with two minutes left of normal time, Origi, on for Romelu Lukaku, rifled home from Eden Hazard's cut back to seal all three points for the Red Devils.
Algeria boosted their hopes of reaching the knockout stages of the 2014 World Cup as they beat South Korea 4-2 in a highly entertaining game at the Estadio Beira-Rio in Porto Alegre.
With Belgium already qualified from Group H, Algeria climbed to second on three points ahead of their final match against Russia on Thursday, while South Korea, along with the Russians, have one point to their name.
Algeria were rewarded for a bright start when on 26 minutes Islam Slimani raced onto a long ball from Carl Medjani to keep his cool and lift the ball into the net.
Just two minutes later they doubled their lead as Rafik Halliche powerfully headed in from Abdelmoumene Djabou's corner, with goalkeeper Jung Sung-ryong in no man's land.
South Korea's defence continued to struggle and it was 3-0 before half-time after Slimani squared for Djabou, who finished first time into the bottom corner.
Son Heung-min offered South Korea hope of a comeback when he pulled a goal back five minutes into the second half, latching onto Ki Sung-yueng's pass and firing the ball under goalkeeper Rais M'Bolhi.
But, after M'Bolhi brilliantly saved a swerving Ki Sung-Yeung effort, Yacine Brahimi restored Algeria's three-goal advantage just after the hour mark as he played a one-two with Sofiane Feghouli before keeping his cool to slot home.
The goals kept coming when on 72 minutes Koo Ja-cheol tapped in from Lee Keun-ho's cross, but it proved to be only a consolation for South Korea.