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'
|Relegation run-in favours Leicester - Walsh|
|Fiorentina v Dynamo Kiev: Pasqual calls for response in second leg|
|Schmidt extends Mainz deal|
|Parma on the market for €20million|
|Zenit v Sevilla: Villas-Boas wary despite key player returns|
|Title a step too far for United, says Evans|
|De Bruyne agent reveals Manchester City talks|
|Kroos not making excuses about absences|
|BREAKING NEWS: Smalling signs new United deal|
|Depay like a young Ronaldo - De Boer|
|Napoli v Wolfsburg: Benaglio eyes return to form|
|Frontzeck: Survival fight is not about me|
|Real can cope with injuries - Ancelotti|
|Dnipro v Club Brugge: Preud´homme prepares to show his hand|
|Silva returns to training after cheekbone scare|
|Villa and Reading charged over alleged FA Cup crowd trouble|
|Zeman resigns from Cagliari post|
|Opportunity knocks as Dyche plans for Barnes absence|
|Berbatov dreaming of Champions League semi-final|
|Benzema joins Real´s injury list|
|Jenkinson: West Ham will not settle for mid-table|
|Montella calm over fan frustrations|
|Blanc: Barca are the model for PSG|
|Newcastle just need three more points - Janmaat|
|Gaya: Six finals left for Valencia|
|Muller wary of Porto counter-attacks|
|Bartomeu plays down Pogba link|
|Verratti hails ´essential´ Ibrahimovic|
|Zidane backs PSG to upset Barca|
|America v Montreal Impact: Klopas unfazed by host´s form|
|Vlaar open to Villa stay|
|Shepherd urges fans not to boycott Newcastle|
|Maritimo 1 Nacional 1: Tiquinho ensures derby finishes all square|
|Fiorentina 0 Verona 1: Diamanti and Neto pay the penalty|
|Elche 1 Real Sociedad 0: Bergara gifts win to hosts|
|Van Persie returns in Under-21 game|
|Turkish Super Lig Review: Galatasaray slip sees Fenerbahce go top|
|Russian Premier League Review: Arsenal Tula and Rostov maintain survival bids|
|Frontzeck named as Korkut´s replacement at Hannover|
|Lopetegui wary of Bayern backlash|
|Pastore plays down Cantona´s world best tag|
|PSG absences no excuse for failure - Blanc|
|Suarez sad to see Gerrard leaving Liverpool|
|Cleber injury adds to Hamburg woes|
|Northern Ireland free to play Romania at Windsor Park|
|Juve sweating on Vidal availability|
|Monaco v Juventus: Evra ready to take control|
|Striking concerns for Chelsea after Drogba injury|
|PSG and Chelsea have bid for Dybala, claims agent|
|Pogba can leave Juve for ´right offer´|
|Bendtner dropped after arriving late for training|
|Messi achievement unrepeatable, says Luis Enrique|
|Football League Preview: Preston and MK Dons battling to join Bristol City|
|Real Madrid v Atletico Madrid: Ancelotti optimistic amid injury concerns|
|Iniesta declared fit for PSG second leg|
|Bale remains a doubt for Atletico clash|
|Schweinsteiger set to face Porto, Ribery to miss out|
|No broken cheekbone for Silva|
|Final appearance can remove negativity at Villa - Fox|
|Bale selected in Football League Team of the Decade|
|PSV director: United and PSG want Depay|
|Korkut sacked by relegation-threatened Hannover|
|Sherwood: Pressure all on Arsenal|
|Newcastle in a ´dangerous moment´ - Colback|
|Kovac hopes to have Modric fit for Euro qualifier|
|Copa Libertadores Preview: Cruzeiro boss Oliveira does not fear sack|
|MLS Review: Revs extend unbeaten run, Timbers stun City|
|Fournier proud and disappointed|
|Shaw ready to make an impact|
|Hazard among best three in the world - Mourinho|
|Carver: Newcastle are in relegation battle|
|CAF Champions League Review: Setif get two away goals, Al Ahly denied late on|
|Inzaghi praises Milan derby officials|
|La Liga Review: Granada frustrate Sevilla, Villarreal´s woes continue|
|Inter should have had a penalty, Mancini fumes|
|Ligue 1 Review: Lyon return top after derby draw|
|Inter 0 Milan 0: Disappointing derby ends in stalemate|
|Primeira Liga Review: Sporting made to battle, Penafiel running out of time|
|Balotelli targets officials in latest social media outburst|
|Bundesliga Review: Werder Bremen edge Nordderby, De Bruyne rescues Wolfsburg|
|Serie A Review: Napoli close on stumbling Roma|
|Pochettino congratulates 30-goal Kane|
|Rodgers questions Liverpool´s mental strength|
|Carver counting on experience after latest defeat|
|Sherwood marvels at Grealish potential|
|Eredivisie Review: Dordrecht relegated as Go Ahead Eagles stun Feyenoord|
|Newcastle United 1 Tottenham 3: Losing streak continues amid fan boycott|
|Kouyate elbow on Silva accidental - Allardyce|
|Aston Villa 2 Liverpool 1: Delph ends Gerrard´s hopes of dream farewell|
|Pellegrini hails City response to derby defeat|
|Silva back home after Kouyate elbow|
|Manchester City 2 West Ham 0: Silva injury sours routine win|
|Bayern Munich v Porto: Neuer rallies Germans for uphill battle|
|Barcelona v Paris Saint-Germain: Marquinhos keeps the faith ahead of Camp Nou test|
|Fer closes in on QPR return|
|Crouch set for surgery|
|Dortmund confirm Tuchel as Klopp replacement|
|Adams leaves relegation-threatened Tranmere|
|Real still unsure over Modric injury|
|Tevez rubbishes Juve exit talk|
|Moyes: I had to fight to keep Rooney at United|
|Perth Glory 3 Melbourne City 1: Maclaren treble the difference|
|Dyche: Burnley are too honest|
|Illarramendi eager for Real stay|
|Hazard issues Chelsea warning|
|MLS Review: Injury-time winner buoys Galaxy, Martins shows class for Sounders|
|Pastore talents ´unpredictable´ - Blanc|
|Liverpool much bigger than City - Rodgers|
|AFC Champions League Preview: Evergrande look to progress|
|Clarke expects distraught Federici to bounce back|
|Toure is City´s scapegoat - agent|
|Allegri praises high-flying Juve|
|Athletic Bilbao 4 Getafe 0: Hosts end winless run|