Guinea have gone through to the Africa Cup of Nations quarter-finals and Mali have been eliminated, despite both qualifying, after lots were drawn at a ceremony in Malabo, Equatorial Guinea.
The lottery system had to be used to determine the Group D second place finishers behind leaders Ivory Coast after both nations finished level with three 1-1 draws in their pool matches.
The teams also could not be separated by points, their head-to-head result, goal difference or goals scored.
It was the first time since 1988 that lots decided who progressed to the next stage of the competition.
"The god of football fortune has smiled upon Guinea after this hard long journey," Amara Dabo, financial director of the Guinea Sports Ministry, who participated in the draw, said.
Both Guinea and Mali had spoken out against the drawing of lots ahead of the ceremony, as they said it was an unfair way of separating the teams.
"Mali do not deserve to be eliminated in this way, just as we do not," Guinea coach Michel Dussuyer said.
Mali boss Henryk Kasperczak added: "We have to solve the problems of qualification without a drawing of lots."
The Confederation of African Football (CAF) has now said it will consider alternative systems in future.
"We have to stand by the regulation but also think about how we improve it," CAF media director Junior Binyam said.
"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."
Guinea will now play Ghana in Malabo on Sunday (February 1).
Contact the writer of this story at [email protected]
January 2015: Lots to decide whether Mali or Guinea progress to Africa Cup of Nations quarter-finals
January 2015: Democratic Republic of Congo and Tunisia through to Africa Cup of Nations quarter-finals
January 2015: Congo and Equatorial Guinea earn surprise African Nations Cup quarter-final berths
January 2015: Ivory Coast salvage late draw against Mali to leave group exactly level