Cameroon booked their place in the quarter-final of the African Nations Cup after twice coming from behind to seal a 2-2 draw against Tunisia in Lubango.
The Indomitable Lions, who needed at least a point to ensure qualification from Group D, fell behind after just 57 seconds thanks to a fine diving header from Amine Chermiti.
It stayed at 1-0 until a minute after half-time, when Samuel Eto'o equalised with a close-range strike, before an own goal from Aurelien Chedjou restored the advantage for the Carthage Eagles.
But Landry N'Guemo responded instantly with an arrowed finish to hand Paul Le Guen's team a place in the next stage.
They were made to fight for it, though, with their opponents off to a sensational start to the game.
After a quick exchange of passes in midfield, the ball was whipped in by Khaled Souissi from the right and Chermiti glanced home the finish.
The Tunisians had another good chance two minutes later when Yassin Mikari's free-kick forced Carlos Kameni to turn the ball away for a corner.
Cameroon searched desperately for an equaliser, but struggled to carve out any real openings as they were kept frustrated by their determined opponents.
Things began to boil over a little as captains Karim Haggui and Eto'o confronted each other after an unfair challenge from the former on forward Mohammadou Idrissou.
Tensions were further heightened when keeper Aymen Mathlouthi looked to have deliberately handled the ball outside the penalty area to cut out an Eto'o shot just short of the half-hour mark.
The referee saw it as only a yellow-card offence and the ensuing 20-yard free-kick from the Inter Milan striker drifted narrowly wide.
Le Guen's side continued to camp in the Tunisian half, but their attacking intent was almost exposed when a fine breakaway between Mikari and Hocine Ragued saw the Sochaux defender send the final shot into the side netting from 10 yards out.
It remained 1-0 at the break and the agitated Indomitable Lions boss had seen enough, bringing in another attacker in Pierre Webo in place of Jean Makoun.
And it proved an inspired change as Idrissou beat the off-side trap to play in the Mallorca forward, whose cut-back was expertly met by Eto'o inside the six-yard box and he finished via an upright.
The anonymous Souheil Dhaouadi could have restored the lead minutes later after picking up on an error from the Cameroon defence, but opted to cross when he should have shot from just inside the box.
The chances continued to flow with Eto'o missing a free header from a Webo cross, before Tunisia coach Faouzi Benzarti responded by throwing on Chaouki Ben Saada.
It was another masterstroke as the Nice midfielder's hopeful cross was met by a header from Chedjou that looped over Kameni into his own goal.
That was in the 63rd minute and it took less than 90 seconds for the Cameroonians to respond - Webo teeing up N'Guemo on the edge of the area and the Celtic midfielder blasting home the finish.
The goal seemed to knock the stuffing out of the Tunisians and they struggled to carve out any real openings thereafter.
To make matters worse, Ammar Jemal was sent off in the closing stages after receiving a second yellow card for an unnecessary push on Idrissou as the north Africans bowed out.