Mali edged through to the Africa Cup of Nations semi-finals after beating co-hosts Gabon 5-4 on penalties.
The game had finished 1-1 after Mali’s Tidiane Diabate cancelled out Eric Mouloungui’s opener with five minutes left on the clock.
Neither side could break the deadlock in extra-time, and Mali knocked out the co-hosts after Pierre-Emerick Aubameyang missed his spot-kick.
Mali will now meet Ivory Coast in the last four in Libreville on Wednesday.
Gabon, who are co-hosting the tournament with Equatorial Guinea and have never reached the semi-finals, had looked on course for their fourth successive win at the tournament when Mouloungui scored off a pullback pass from team-mate Aubameyang.
Earlier in the game, the Gabon squandered a host of chances as Aubameyang struck the bar and Daniel Cousin saw his shot bounce back off the post.
Mali, whose defence looked disorganised for much of the game, created few chances but might have equalised had Modibo Maiga not scuffed his shot.
However, the visitors snatched an equaliser when substitute Diabate struck in the 85th minute.
After extra-time passed without any goals, Seydou Keita scored the decisive kick in the shoot-out after Aubameyang had his effort saved.