Egypt captured first place in Group D of the 2017 Africa Cup of Nations in Gabon by picking up a 1-0 victory over Ghana on Wednesday, with both teams reaching the quarter-finals. Mohamed Salah tallied the deciding goal in the 11th minute for Egypt, who finished with seven points in the group and will take on fellow north Africans Morocco in the final eight. Ghana had already advanced to the quarters before the match and took second place in Group D with six points, setting up an enticing knockout stage date with the Democratic Republic of Congo. Those two countries have combined for six Afcon titles, but none since Ghana's fourth and latest crown in 1982. The other match in Group D played Wednesday saw Mali and Uganda split the spoils 1-1, with Farouk Miya scoring for Uganda in the 70th minute and Yves Bissouma equalizing on 73 minutes. Mali ended third in the group with two points, and Uganda exited the tournament with one point. Egypt went into the game knowing a draw would be enough to advance. But Hector Cuper's Pharaohs were thinking of the full three points against Ghana. "We didn't want to use the luxury of playing for a draw. This is what we always do. We want to win," Egypt's Argentine coach said afterwards. "I would have liked to have played better, especially in the second half. We prepared a lot of strategies but we played against a very tough team and sometimes we needed to make sure that the game did not end in a draw." Playing their final group match in Port-Gentil, Egypt did not wait long and grabbed the lead 1-0 on a set piece in the 11th minute. Salah unleashed a brilliant free kick through the wall and into the far left corner, leaving Ghana keeper Brimah Razak helpless. It was almost 2-0 on 38 minutes as Razak tried to clear a ball but passed it right to Marwan Mohsen, who luckily for the Black Stars keeper sent a lob over the bar. Ghana captain Asamoah Gyan was forced off with a groin injury in the 41st minute and Black Stars faithful hope the star striker will not miss the quarters. Ghana found a rare chance three minutes before the break with Daniel Amartey heading a free kick just wide. Egypt rarely pushed forward in the second half while Ghana seemed to lack the final push on attack. The Black Stars did have one final chance in the 90th minute with Jordan Ayew serving up an excellent strike from the edge of the box but Egypt's 44-year-old keeper Essam El-Hadary batted it away to preserve the victory. Mali and Uganda meanwhile were playing their contest on a water-logged pitch in Oyem. Mali knew they needed a victory and a Ghana win over Egypt to reach the quarter-finals. The Eagles did threaten the Uganda goal in the eighth minute as Moussa Marega hit the side netting and Yacouba Sylla's long blast went just over the bar on 24 minutes. After not scoring in their first two matches, Uganda finally tallied their first goal of the tournament - and first Afcon goal since their last appearance in 1978 - with Miya hammering his blast into the upper left corner just out of the reach of Mali keeper Oumar Sissoko in the 70th minute. Mali did not let Uganda celebrate long as they equalized on an equally impressive rocket, with Bissouma's free kick from over 30 yards out finding the upper left corner. The Africa Cup of Nations takes its first break after the completion of the group stage. The quarter-finals will start on Saturday with Burkina Faso facing Tunisia and Senegal playing Cameroon. The other two final eight encounters - DR Congo vs Ghana and Egypt against Morocco - will be played on Sunday.