Cristiano Ronaldo's goal saw Portugal beat Ghana 2-1 in Brasilia, but it proved academic as both sides crashed out of the FIFA World Cup.
Coming into the final Group G clash, both sides knew only victory would give them a chance of progressing to the second round, and even then they were dependent on the game between Germany and the United States, with a draw in Recife good enough to see those two teams through regardless of events in the capital.
Portugal, needing a five-goal swing to overtake the USA in second place, went in front after 30 minutes when Ghana defender John Boye's wild clearance from Miguel Veloso's cross diverted the ball over goalkeeper Fatawu Dauda and into the net.
Ghana responded in the second half, Asamoah Gyan's header making him the highest ever scorer for an African nation at World Cup finals, surpassing the mark of five set by Cameroon's Roger Milla.
With Germany beating the Americans 1-0 on Thursday, a 2-1 victory for Kwesi Appiah's men would have seem them through and Abdul Majeed Waris was guilty of a glaring miss shortly after Gyan's equaliser, nodding wide from close-range with no defenders around him.
They were left to rue that miss 10 minutes from time, Ronaldo firing home from 12 yards after a defensive mix-up between Jonathan Mensah and Dauda, the keeper flapping hopelessly at a high ball.
Portugal made four changes from the side that drew 2-2 with the United States, while Ghana showed two alterations, Waris and Emmanuel Agyemang-Badu coming in for Kevin-Prince Boateng and Sulley Muntari, suspended by the Ghanaian Football Association for alleged disciplinary breaches.
Ronaldo had the first effort of note in the fifth minute as his audacious lob from wide on the right caught out Dauda but struck the crossbar and rebounded to safety.
The Portugal captain threatened again seven minutes later, testing Dauda with a trademark dipping free-kick from 30 yards.
Ronaldo was at the forefront of all of Portugal's attacking play and ought to have put his side ahead in the 19th minute.
Joao Pereira delivered a pinpoint ball from the right and the Real Madrid man, unmarked six yards from goal, directed his header straight at Dauda, who parried away.
A minute later Ghana almost hit the front as Gyan was denied by the legs of Beto after the Portugal defence failed to deal with an aerial ball.
Portugal continued to make most of the running and got their noses in front on the half-hour mark, Boye slicing Veloso's cross from the left into the net via the bar and right-hand post.
Ronaldo brought another save out of Dauda two minutes later, while Gyan continued to pose a danger, heading wide after meeting Christian Atsu's cross.
After a quiet start to the second half Ghana equalised with 57 minutes gone, Gyan nodding home at the far post following a superb cross from Kwadwo Asamoah with the outside of his left foot.
Waris wasted a glorious chance to put Ghana in front four minutes later, somehow heading wide from six yards after being picked out by Gyan.
Ronaldo - relatively quiet throughout the tournament - ultimately had the final say as he lashed in a left-footed strike after Dauda feebly palmed Mensah's wayward header into his path, but it mattered little as both sides' hopes were dashed.
|Coach: Paulo Bento|
for João Pereira 61'
for Éder 69'
for Beto 89'
|Pique focused ahead of crucial period for Barca|
|Coventry City 0 Leyton Orient 1: Wright´s goal lifts visitors out of relegation zone|
|US senators want Russia removed as 2018 World Cup host|
|Advocaat hoping to see Brown again this season|
|Aubameyang eyes Europa League spot ahead of Bayern test|
|Pique expecting Messi to be fit to face Celta|
|Sterling: I´m not a money-grabber|
|Elche players and staff cancel club commitments|
|Milik makes permanent Ajax switch|
|Ligue 1 Preview: PSG out to extend Classique record against Marseille|
|Real´s Pepe suffers thigh injury|
|League One Preview: Clough not panicking in promotion bid|
|West Ham set to welcome Reid back for Leicester|
|League Two Preview: Johnson begins survival bid with Cheltenham|
|Icardi keen to commit his future to Inter|
|Swansea dealt Carroll injury blow|
|Jardim keen to maintain Monaco´s Ligue 1 surge|
|Debuchy relieved after stepping up Arsenal comeback|
|Championship Preview: Bournemouth ready to unleash Jones at Ipswich|
|Alaba faces seven-week absence|
|West Brom´s Mulumbu wary of tricky run-in|
|Elliott unsure over Carver future|
|UEFA and FIFPro launch third-party ownership complaint|
|Lucas keen for Liverpool return|
|UEFA to investigate disruptions in Georgia|
|Selke swaps Bremen for Leipzig|
|Hurst backs Allardyce amid uncertain future|
|Herrmann pens Gladbach extension|
|Pique calm over Spain defeat|
|Queiroz leaves Iran|
|Hiddink fumes at booing of Iniesta|
|La Liga Preview: Sevilla working on new Emery deal ahead of Bilbao´s visit|
|Santos: Portugal attitude was fine in Cape Verde defeat|
|Bayern face anxious wait over Alaba injury|
|´Title is within reach´ for Marseille - Ocampos|
|Martino hails Argentina performance|
|MLS Preview: DC United, Orlando City battle for top spot|
|Panama 2 Costa Rica 1: Perez, Tejada end visitors´ unbeaten run|
|Kluivert´s Curacao advance to second round|
|Mexico 1 Paraguay 0: Eduardo Herrera´s debut goal secures victory|
|Mexico 1-0 Paraguay: Eduardo Herrera's debut goal secures victory|
|Argentina 2 Ecuador 1: Pastore the hero in Messi´s absence|
|Peru 0 Venezuela 1: Martinez goal settles heated contest|
|Wilmots pleased with Belgium´s response|
|Hodgson satisfied with draw|
|Argentina 2-1 Ecuador: Pastore the hero in Messi's absence|
|Real agree to sign Danilo|
|Turin return evoked ´strong emotions´ for Conte|
|Hiddink looking to build on Spain win|
|Del Bosque frustrated by friendly defeat|
|Bradford City 0 Chesterfield 1: Harrison strike moves visitors into play-off places|
|Portugal 0 Cape Verde 2: Hosts suffer shock friendly defeat|
|Townsend takes swipe at TV pundit Merson|
|Plane issue grounds England squad|
|Israel 0 Belgium 1: Fellaini nets again as Kompany sees red|
|N´Koulou returns to full Marseille training|
|Netherlands 2 Spain 0: Hosts ease pressure on Hiddink|
|Italy 1 England 1: Townsend leveller rescues draw|
|Ghana 1 Mali 1: Sako spot-kick denies Black Stars|
|Luxembourg 1 Turkey 2: Calhanoglu stakes claim with late winner|
|Ghana 1-1 Mali: Sako spot-kick denies Black Stars|
|Italy 1-1 England: Townsend rocket earns draw for Three Lions|
|Rummenigge marvels at ´genius´ Guardiola|
|Switzerland 1 United States 1: Stocker seals draw after Altidore red|
|Young players should not need a break, says Dyche|
|Tottenham acquire final piece of land for new stadium|
|Portugal 0-2 Cape Verde Islands: African minnows claim historic victory|
|Netherlands 2-0 Spain: Rejuvenated Dutch ease pressure on Hiddink|
|Switzerland 1-1 USA: Altidore sent off in friendly draw|
|Palestinian FA speaks out against Israel-Belgium venue selection|
|Valdes enjoying football again after injury nightmare|
|Emotional Cha retires ´a happy man´|
|Dortmund´s Kirch suffers knee injury|
|Newcastle need to be mentally prepared, says Williamson|
|Leno ´knows nothing´ of Real interest|
|Tunisia to compete in AFCON after apology|
|Van der Vaart not allowing future to affect his game|
|Vlaar: Sherwood has reduced stress levels|
|Roma hit by Gervinho hamstring blow|
|Jones optimistic over Everton´s strike partnership|
|Milik sustains knee ligament damage|
|Georgia fear stadium closure for Scotland clash|
|Zamparini: Juventus and Arsenal have bid for Dybala|
|South Korea 1 New Zealand 0: Lee nets late winner|
|Japan 5 Uzbekistan 1: Five-star hosts maintain Halilhodzic start|
|European clubs benefit from UEFA agreement|
|Vassell: Sky is the limit for Kane|
|Manchester United move would be an ´honour´ for Coentrao|
|Insigne out to bolster Napoli season after lay-off|
|Rooney warns Kane over ´clever´ Italy defenders|
|Rangers results reveal £500,000 Newcastle clause|
|Southampton announce £33.4m profit|
|´I am a very flexible man´ - Van Gaal|
|A-League Preview: Top spot up for grabs|
|Portugal - Cape Verde Preview: Andre and Oliveira eager for international bows|
|Puerto Rico 0 Canada 3: Floro´s men rout hosts|
|Xavi denies Al Sadd link|
|Fernando´s life ban upheld by CAS|
|Argentina - Ecuador Preview: Messi remains doubtful for friendly|
|Falcao equals Colombia´s all-time scoring record|
|Macedonia trip good learning curve - Postecoglou|