Portugal snatched a dramatic equaliser deep into injury time to force a 2-2 draw with the United States and keep their World Cup hopes flickering on Sunday.
Silvestre Varela headed in a cross from Portugal captain Cristiano Ronaldo in the fifth and final minute of stoppage time at the Amazonia Arena in Manaus to grab a vital point.
The last-gasp leveller deprived the United States of a famous win which would have seen them complete a remarkable qualification from Group G, which also includes Germany and Ghana.
It also saved Ronaldo and Portugal from an embarrassing first round elimination from a group they were firmly expected to qualify from.
The result leaves the United States and Germany level on four points in Group G, with Portugal and Ghana on one apiece.
A draw between the Germans and Americans in the final round of matches on Thursday would see both teams advance.
US coach Jurgen Klinsmann hailed his team's heroic display.
"Obviously the last second is unfortunate but my guys were magnificent," he said.
"We just have to get a result against Germany.
"My guys went to the limit but now they have to pick themselves up and despite this result we will go into the game with a lot of confidence."
Portugal winger Nani had shot the Europeans into the lead on five minutes but Klinsmann's side rallied thereafter and dominated for long periods.
They got their reward when Jermaine Jones equalised on 64 minutes with a rasping shot.
Then nine minutes from time Dempsey chested in a cross to put the US 2-1 up.
It seemed as if that would be enough for victory but Portugal poured forward with one last desperate attack to score.
In other games Sunday, teenager Divock Origi fired Belgium into the last 16 with a 1-0 win over Russia in Group H.
Algeria trounced South Korea 4-2 to notch a long-awaited first World Cup win in 32 years in the day's other game.
Belgian substitute Origi pounced on 88 minutes to settle a drab encounter at the Maracana Stadium.
Belgium coach Marc Wilmots said Origi's match-winning contribution illustrated the depth and hunger in his squad.
"I know people are not happy to be on the bench," said Wilmots.
"But what is important is Belgium being able to rely upon totally devoted players when they are called upon.
"For the last 20 minutes I had people dying to be brought off the bench."
The win saw Belgium guaranteed a place in the second round ahead of their final group game against South Korea.
But the defeat leaves Fabio Capello's Russia facing a tense battle to qualify, with only one point from two games.
"Of course I still believe. We have no other option than to go out and beat Algeria," Capello told reporters
Algeria thrust themselves into pole position to qualify along with Belgium after thumping a woeful South Korea in Porto Alegre in Group H's other game.
It was Algeria's first win at a World Cup since the 1982 finals in Spain.
Islam Slimani, Rafik Halliche and Abdelmoumene Djabou effectively settled the contest before half-time as Algeria raced into a 3-0 lead.
Son Heung-Min gave Korea a flicker of hope five minutes after half-time, but Yacine Brahimi made it 4-1 on 62 minutes.
Koo Ja-Cheol added a consolation goal for Korea, who must now beat Belgium in their final match on Thursday to have any chance of making the last 16.
AFP
Mon Jun 23 2014
Portugal's goalkeeper Beto, center, clears a ball ahead of United States' Clint Dempsey, left, and Portugal's Joao Pereira, right, during the group G World Cup soccer match between the USA and Portugal. - AP Photo/Themba Hadebe
Who is Prabowo Subianto, incoming president of Indonesia?
A wealthy ex-general with ties to Indonesia's popular outgoing president and its dictatorial past, looks set to be its next leader.
Iran's supreme leader says Hamas leader's death will not halt 'Axis of Resistance'
The "Axis of Resistance", built up with years of Iranian support, includes Hamas, the Lebanese Hezbollah group, the Houthi movement in Yemen, and various Shi'ite groups in Iraq and Syria.
Putin says Russia willing to seek compromises between Iran and Israel
Russia is ready to help seek compromises between arch-foes Israel and Iran, President Vladimir Putin said on Friday, saying these would be difficult but possible.
What proposals will Russia push at the BRICS summit?
The proposal is also to establish a BRICS reinsurance company to allow uninterrupted shipment of goods and key commodities between members.
Indonesia's free meals plan in the spotlight as Prabowo readies for office
Prabowo calls the programme one of the main drivers of economic growth, eventually set to add an estimated 2.5 million jobs.
Astro AWANI's revamped English news website, AWANI International, launches on Oct 21
Astro AWANI's revamped English platform delivers in-depth global news and expert analysis to keep you informed on key developments.
Israeli strikes kill 33 people in Jabalia refugee camp in Gaza, medics say
Residents of Jabalia said Israeli tanks had reached the heart of the camp after pushing through suburbs and residential districts.
Liam Payne's ex-partner calls for media restraint after 'painful' death
Cheryl Tweedy used her statement to urge the media to remember they had a seven-year-old son, Bear, who could read the reports.
Analysts: Indonesia's strong MoF leadership team to boost investor confidence
Sri Mulyani Indrawati as head of Indonesia's Ministry of Finance is expected to instil confidence among investors.
Biden offers both a carrot and a stick to Israel as his term nears an end
Israel has frequently resisted US advice and has caused political difficulties for the Biden administration.
Putin says BRICS will generate most of global economic growth
Russian President Vladimir Putin will host a summit of the group in the city of Kazan on Oct. 22-24.
ISIS Malaysia's perspective of Budget 2025
An excellent rakyat-centric budget under the overarching principle of a caring and humane economy.
Budget 2025: Record increase in STR, SARA aid initiatives
The government will provide a significant boost to the Sumbangan Tunai Rahmah (STR) and Sumbangan Asas Rahmah (SARA) initiatives next year.
Budget 2025: EPF contributions to be made mandatory for foreign workers – PM Anwar
The government plans to make it compulsory for all non-citizen workers to contribute to the Employees Provident Fund (EPF).
What policies to expect from Indonesia's new President Prabowo
Prabowo will be open to foreign investment, his aide has said, such as by offering investors management of airports and sea ports.
Budget 2025: Govt allocates RM470 mil to empower women's participation in PMKS
The Women's Leadership Apprenticeship Program will be intensified as an effort to produce more female corporate personalities.
Israel sends more troops into north Gaza, deepens raid
Residents of Jabalia in northern Gaza said Israeli tanks had reached the heart of the camp, using heavy air and ground fire.
Indonesia ramps up security ahead of Prabowo's inauguration
Prabowo Subianto will be sworn in as Indonesia's president on Sunday with Vice President-elect, Gibran Rakabuming Raka, also taking office.
Immediate allocation of RM150 mil for local authorities, DID to tackle flash floods
Datuk Seri Anwar Ibrahim said this allocation is intended to address the recent flash floods that hit the capital and several major towns.
Budget 2025: Sabah, Sarawak to continue receiving among highest allocations - PM
Sabah and Sarawak continues to be prioritised under Budget 2025, with allocations of RM6.7 billion and RM5.9 billion respectively.