Sadio Mane sent Senegal into the quarterfinals of the African Cup of Nations, where it will meet a Benin team that dumped out Morocco to start the knockout stages with a major upset on Friday.

Mane scored early to give Senegal a 1-0 win over Uganda in their round-of-16 match at Cairo International Stadium. The Liverpool forward also had a second-half penalty saved, but it didn't cost Senegal.

Mane has three goals in three games at the African Cup in Egypt — he's also missed two penalties — and he's threatening to upstage Liverpool teammate Mohamed Salah, the star of the host's team.

Senegal will next face surprising Benin, which celebrated its first appearance in the knockouts with its first-ever win at the African Cup. Benin beat Morocco 4-1 on penalties after surviving a tumultuous time at Al Salam Stadium.

Benin scored first in regulation, gave up an equalizer to a foolish defensive error, and also conceded a penalty in injury time that Morocco forward Hakim Ziyach missed. Benin then had defender Abdou Adenon sent off in bizarre fashion early in extra time for showing dissent to the referee but survived to win the shootout.

Sofiane Boufal and Youssef En-Nesyri missed their spot kicks for Morocco. Seibou Mama buried the decisive penalty to send the underdog into the quarters. Benin players and officials in suits sprinted across the field celebrating.

Morocco won all three of its group games and hadn't conceded a goal before Friday. Benin lost eight out of nine games at the African Cup before this tournament and had never got past the group stage. It progressed to the last 16 this year with three draws in group play.

Moise Adilehou gave Benin the surprise lead in the 53rd minute when he stuck out a foot to volley home from a corner.

En-Nesyri equalized in the 76th and the Moroccans should have won it with their penalty five minutes into injury time at the end of the 90. Ziyach smacked the penalty off the post and Benin survived.

Adenon's sending off was strange. He was helping a teammate who had cramps when referee Helder de Carvalho of Angola walked over and tried to pull Adenon away. The Benin player shrugged off the ref's arm and that was ruled dissent and earned him a second yellow and a red card.

Adenon stayed on the field for minutes afterward protesting the decision and got into a heated argument with Morocco players and team officials in the dugout as he left.

Benin threatened to self-destruct.

Jordan Adeoti gave away the equalizer for Morocco with a foolish decision to try and dribble his way out of trouble at the back. He lost possession and En-Nesyri punished the error.

Rattled, Benin lost its discipline and gave away the late penalty when captain Stephane Sessegnon hacked down Achraf Hakimi. With victory and a place in the quarterfinals up for grabs, Ziyach hit his penalty low and hard but it thundered off the bottom of the right post. That was the last act of normal time.

Benin held out under pressure through extra time.

Boufal hit his penalty over in the shootout for Morocco's first miss. Benin goalkeeper Owolabi Kassifa saved En-Nesyri's by pushing it onto the crossbar.

Mama kept his cool to take Benin into the quarters and even further into unfamiliar territory.

Mane's winner against Uganda came in the 15th minute after Senegal intercepted possession and struck with a lightning-fast counterattack. Mbaye Niang set up an unmarked Mane, who slid the ball into the bottom right corner.

Mane also won a penalty in the 59th minute when he was taken out by Uganda goalkeeper Denis Onyango after Uganda again gave the ball away deep in its own half.

Onyango was booked early in the game but escaped a second yellow and stayed on the field.

He dived to his left to stop Mane's penalty but it didn't matter in the end.

___

More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports