A 96th-minute winner from Sadio Mane earned Senegal a 1-0 win over Malawi and a place at the Africa Cup of Nations finals in Morocco next year, but Ghana are in serious danger of missing out after a surprise loss to Sudan on Tuesday.
Senegal had 30 attempts at goal against their hosts but it took until the final seconds for Mane to seal victory with a 25-yard free-kick that curled around the wall and into the bottom corner of the net.
The 2021 winners, who recently parted ways with long-time coach Aliou Cisse, join Burkina Faso as the qualified nations from Group L in the 24-team finals with two more matches to play in the November international window.
Ghana slumped to a 2-0 loss against Sudan in neutral Libya as Ahmed Al-Tash and Mohamed Abdel Rahman scored within three minutes of each other in the second half.
DRC also qualify
Ghana look set to miss a first continental finals since 2004 having managed a paltry two points from their four games, five adrift of the qualification positions with a difficult trip to pool leaders Angola next up.
The Democratic Republic of Congo qualified following a 2-0 victory in Tanzania as Meschack Elia scored a brace, his first in the 88th minute and the second deep into stoppage time.
They have a full haul of 12 points from their four games.
Coach Avram Grant's Zambia claimed an important 1-0 win over Chad to take a big step towards qualification thanks to Kennedy Musonda's goal 20 minutes from the end.
Gabon 'on course'
Gabon are also on course after a 2-0 win over Lesotho in neutral Durban, with Shavy Babicka and Rody Effaghe grabbing goals in the second half.
Uganda beat South Sudan 2-1 in Juba and their qualification will be confirmed later on Tuesday if South Africa win in the Republic of Congo.
Hosts Morocco, Cameroon and Algeria are the other teams already in the finals line-up.
➤ Click here to follow our WhatsApp channel for more stories.