Ghana reached the semi-finals of the All Africa Games when beating hosts Mozambique 4-3 in a thrilling Group A tie on Saturday.
Osumanu Otoo proved the spark for the Ghanaians as he plundered a first-half hat-trick to hand his side a 3-0 lead at the break.
Just after the hour, Manuel Uetimane pulled a goal back for the Mozambicans but any hope of a fight-back was hit when Ghana went 4-1 up a minute later.
Mozambique refused to be cowed and goals from Manuel Fernandes and Jonas Tomocene ensured a tense finale.
Ghana take second spot in Group A, behind leaders South Africa.
The men's defeat capped a disappointing day for the hosts, with Mozambique's women having been thumped 7-1 by Algeria in Group A earlier on Saturday.
Mozambique started well but conceded against the run of play as Benziane Naima Bouhani opened the scoring midway through the half.
But the hosts equalised when Maria Mutola, a former 800m specialist who has switched to football in recent years, netted just before half-time.
The second half was a different story though as Algeria hit an unanswered six goals.
Bouhani grabbed a second, while Djamila Marek also scored a brace, with Leila Meflah, Fethia Bekhedda and Farida Yahi also firing home.
Algeria took second spot behind Cameroon in Group A, where Mozambique finished last, and the North Africans will meet either South Africa or Ghana in next week's semi-finals.