Fifa president Gianni Infantino watched Malawi lose 2-1 to Zambia in Rabat on Wednesday, but the surprise package from southern Africa still secured a place in the quarter-finals of the Women's Africa Cup of Nations.
Malawi were joined in the knockout stage from Group C by 10-time champions Nigeria, who beat Egypt 6-2 in a match played at the same time.
The results left Malawi, Nigeria and Zambia level on six points, with head-to-head records deciding the final standings.
Malawi, the lowest-ranked of the 16 teams at the tournament, finished top of the group and will face either Ghana or Mali in the quarter-finals, with a place at the 2027 World Cup in Brazil also at stake.
Follow us on WhatsApp | LinkedIn for the latest headlines
Nigeria, who finished second, play Cameroon in Sunday's other quarter-final. Hosts Morocco face South Africa and Ivory Coast play Algeria on Saturday.
Infantino's appearance at the match comes amid continued scrutiny of his leadership, after he was forced to abandon a plan to open the World Cup to private investment.
He held emergency talks with Fifa directors in Morocco earlier in the week.
Fifa later apologised while reaffirming its "full support" for Infantino, saying in a statement that "errors were also made after the proposal was leaked to media".
Former Portugal international Luis Figo was among those to criticise Infantino, writing in the UK newspaper Daily Mail: "I could write 10,000 words on the problems at Fifa. But the solution needs only three: Infantino must go."
Canadian Prime Minister Mark Carney also said he had no confidence in Infantino "given what transpired".
The row began after Infantino proposed bringing in private investors without informing senior Fifa colleagues. The plan was dropped following backlash led by European body Uefa.
Infantino watched the group match alongside Fifa secretary general Mattias Grafstrom and CAF first vice-president Fouzi Lekjaa, who backed the decision to shelve the investment plan, saying it "prioritises the unity and cohesion of all the member associations of Fifa".
In the match itself, Zambia's Barbra Banda, the tournament's leading scorer, opened the scoring after two minutes, with Prisca Chilufya adding a second before half-time.
Tabitha Chawinga pulled a goal back for Malawi in the 72nd minute, a result that was enough to send them top of the group on head-to-head standings.
Nigeria's win over Egypt included three penalties, converted by Asisat Oshoala, Christy Ucheibe and Rasheedat Ajibade. Gift Monday, Uchenna Kanu and Joy Omewa also scored for Nigeria, who led 2-1 at half-time. Nadin Ghazy scored twice for Egypt.
