Ghana would need to win its final Group B game at the Women's Under-17 World Cup to stand a chance of reaching the next round after losing to Germany in Christchurch.
Despite dominating the Germans, the Black Maidens saw the European champions run away 3-2 winners, to become the first team to advance to the quarter-finals.
But the Germans, who won their first game 5-0 against Costa Rica were made to earn their victory as Ghana fought back impressively in the second half.
After only five minutes into the start of the game, Ghana's back-line was breached, when Tabea Kemme was fouled by Linda Eshun inside the box. Dzsenifer Marozsan expertly slotted home the penalty.
The Germans doubled their lead on 35 minutes when Marozsan, again scored, this time from a corner to end the first half 2-0 for her side.
However, the second half produced a thrilling game with the Germans hitting the bar twice.
But it was Ghana who scored the first goal of the half, through Florence Dadson in the 65th minute. And that was the striker's second goal of the tournament.
Four minutes after the Ghana goal and Leonie Maier restored the Germans' two-goal lead.
The Black Maidens worked their way into the German defence again as Isha Fordjour got Ghana's second goal with four minutes to go.
The Ghanaians turned on the pressure for the equaliser but run out of time to draw the game.
Ghana plays Costa Rica in the final group game on Tuesday in Wellington.
Ghana line up: Patricia Mantey, Henrietta Annie/Edem Atovor, Linda Eshun, Juliet Acheampong, Elizabeth Cudjoe, Elizabeth Addo/Isha Fordjour, Florence Dadson, Mercy Myles, Mantenn Kobblah, Deborah Afriyie/Candice Osei-Agyemang, Rosemary Ampem
Unused Subs: Margaret Otoo, Linda Aboagye, Ellen Coleman, Priscilla Okine, Abena Ampomah, Samira Suleman, Priscilla Saahene