Guinea had to win a lottery against Mali on Thursday to reach the Africa Cup of Nations quarter-finals stage.
The side will face Ghana on Sunday following the draw at a Malabo hotel.
Guinea and Mali had finished level in Group D after they drew all three pool matches 1-1.
It is the first time lots have decided a team’s qualification in the tournament since 1988, when Algeria profited at Cote D’Ivore’s expense.
Cote D’Ivore finished top of Group D in Equatorial Guinea after beating Cameroon 1-0 – the only match in the group not to finish in a 1-1 draw.
One representative from Guinea and Mali took part in Thursday’s draw, which involved selecting balls from a bowl.
Mali’s football association president Boubacar Diarra went first and pulled out the ball that placed them third in the group.
With Diarra in tears, Amara Dabo, financial director of the Guinea sports ministry, then drew the ball that confirmed his side in second place.
Dabo said: “The god of football fortune has smiled upon Guinea after this hard long journey.”
Guinea coach Dussuyer and Mali boss Henri Kasperczak had both said before Thursday’s draw that lots were an unfair way of deciding who went through.
“Mali do not deserve to be eliminated in this way, just as we do not,” Dussuyer said.
Kasperczak added: “We have to solve the problems of qualification without a drawing of lots.”
The Confederation of African Football (Caf), which organises the tournament, said that alternative systems to separate teams would be considered in future.
Caf media director Junior Binyam said: “We have to stand by the regulation but also think about how we improve it.
“It’s not fair to have a team going out like this. It really is the worst decision – to have to make a decision this way – because everybody expected it would be decided on the field.”