Ghana and Libya have booked their places in the quarter-finals of the African Nations Championship.
Kwabina Adusei scored a 76th-minute penalty to give Ghana a 1-0 victory over Ethiopia and ensure the Black Stars finished top of Group C.
Libya, who had been top of the table, came back from 2-0 down to draw with Congo and book their last-eight spot.
They had been heading for the exit until Abdelrahman Fetori scored on 93 minutes to make it 2-2.
Libya's last-gasp strike turned the tables on Congo, who had looked to be qualifying ahead of their opponents - and the Red Devils will head home reflecting on what might have been.
Moise Nkounkou gave them the lead after 36 minutes, scoring with a close-range volley, and eight minutes after the break Hardy Binguila doubled Congo's advantage when he smashed in a shot from 25 yards.
They held the lead until the 75th minute, when Abdelsalam Omar converted from a cross to give Libya hope.
And just as time was about to run out, Fetori hit a speculative effort from about 30 yards that seemed to bounce over the arm of the diving goalkeeper.
It put Libya through on five points, with Congo one point behind them.
There was no such drama in the group's other tie where Ghana needed only a solitary strike to seal their win and claim top spot with seven points.
On 77 minutes Adusei converted from the penalty spot after Salahadin had brought down Seidu Bancey.
Ghana and Libya will find out their quarter-final opponents after the conclusion of Group D on Wednesday.