Sadio Mane scored the winner before missing another penalty as Senegal beat Uganda in Cairo to reach the Africa Cup of Nations quarter-finals.
Liverpool's Mane produced a clinical low finish then won a penalty after being fouled by keeper Denis Onyango, who had already been booked.
Mane, who had missed from the spot in the previous game against Kenya, was denied after the referee opted against sending the keeper off.
Allan Kateregga went close for Uganda.
Senegal, who are seeking a first Africa Cup of Nations triumph, will meet Benin, surprise winners over Morocco, in the last eight in Cairo on 10 July.
Despite his penalty miss, Mane is leading scorer at the tournament after scoring his third goal, two of which have come from the spot.
Mane has missed two penalties in two games at the Africa Cup of Nations in Egypt
Uganda's build-up to the tie was disrupted by a pay dispute which saw players boycott training on Tuesday.
Emmanuel Okwi and substitute Kateregga, from a late free-kick, both forced saves from Alfred Gomis but Senegal's experience saw them through.