Sudan advanced into the African Nations Cup quarter-finals after a 2-1 win over Burkina Faso on Monday handed them second place in Group B by the slimmest of margins.
Two goals by Mudather Tayeb ensured Sudan a first win in 42 years at the tournament to edge Angola on goal difference for the runner-up berth after they went down 2-0 to group winners Ivory Coast in Malabo.
Sudan, who finished with a level goal difference compared to Angola's minus one, will meet Zambia in the first quarter-final in Bata on Saturday.
They rode their luck to end a run of 11 games without victory at the finals, overcoming an early collision that cost them a key defender, a strong penalty appeal for their opponents and a disallowed effort by Burkina Faso.
Burkina Faso substitute Issiaka Ouedraogo pulled a goal back with virtually the last touch of the match after he had missed two gilt-edged chances, the first early in the second half with just the goalkeeper to beat and the second late in the game when he actually went round the goalie but still hacked wide.
Tayeb scored against the run of play in the 33rd minute to give Sudan the lead.
With 10 minutes left he scored a second, taking advantage of comical goalkeeping from Daouda Diakite, who hesitated to clear a long ball allowing Tayeb to steal the ball and score the easiest of goals.
Sudan lost defender Nagmaldien Abdullah after a horror clash with his own goalkeeper Akram El Hadi Salem in the sixth minute and were fortunate to see the referee fail to award a penalty for Jonathan Pitroipa after 20 minutes.
Burkina Faso, who lost all three matches, fielded 16-year-old Chelsea academy player Bertrand Traore as a second half substitute, making him the third youngest player in the history of the tournament.