Botswana, Mozambique and Tanzania claimed the final berths in next year's African Cup of Nations finals as the qualifying competition played to an exciting conclusion on Tuesday.
Botswana pulled off an unlikely draw away against Egypt to make sure of the point they needed to qualify for the first time while Tanzania edged Guinea 1-0 at home in Dar-es-Salaam.
Mozambique needed to avoid defeat away in their Lusophone derby against Guinea-Bissau to go through but secured a surprise 2-1 win to qualify for a second successive tournament.
A home loss to Mali last week put Mozambique's hopes in peril and offered Guinea-Bissau a chance to leapfrog them in the Group I standings with a home win.
Mozambique holds on for spot
But Bruno Langa scored after nine minutes to make matters more difficult for Guinea-Bissau and although the hosts equalised through Everton's Beto before half-time, Mozambique restored their advantage in the 52nd minute through Stanley Ratifo.
They then held on for a place in the finals in Morocco in December next year.
Botswana needed a point away in Cairo but were not given much chance in their last Group C fixture.
However, Omaatla Kebatho put them ahead after only eight minutes as he capitalised on poor defending.
Salah rested
Egypt, who rested Mohamed Salah for this international window, were level seven minutes later through Mahmoud Trezeguet, leaving Botswana with an uphill task to hold onto their point.
Egypt had 82% of the possession and 29 attempts thereafter but could not force the victory.
Mauritania would have qualified had Egypt won after they beat the Cape Verde Islands 1-0 at home but finished a point behind Botswana.
Tanzania's meeting with Guinea was a straight shootout for second place in Group H with the hosts needing a win and Guinea a draw.
Tanzania's fourth AFCON appearance
Tanzanian veteran Simon Msuva got the game's only goal in the 61st minute to put his country into the finals for a fourth time.
The rest of the 13 qualifying matches played on Tuesday had no bearing on places, with 21 of the 24 finalists already decided.
The 21-year-old Dorgeles Nene scored a hat-trick as Mali romped to a 6-0 win over Eswatini in Bamako while Simon Adingra celebrated being named one of the five nominees for this year's African Footballer of the Year award with a goal for holders Côte d'Ivoire as they beat Chad 4-0 in Abidjan.
But they still finished second in Group G to Zambia, who won 2-0 away against Sierra Leone.
There was an upset as Ethiopia ended already-qualified Democratic Republic of Congo's unbeaten run with a 2-1 away win in Kinshasa with Mohammednur Nasir scoring the winner six minutes into stoppage time.
➤ Click here to follow our WhatsApp channel for more stories.