Equatorial Guinea reached the last 16 at the Africa Cup of Nations after beating Sierra Leone 1-0 – a result which eliminated the Leone Stars.
Midfielder Pablo Ganet curled in from the edge of the area to net the only goal seven minutes before the break.
Sierra Leone had needed a point to progress, but veteran striker Kei Kamara saw an 84th-minute penalty saved by Jesus Owono.
The Equatoguineans finish second in Group E behind Ivory Coast.
Juan Micha’s side will now face the winner of Group F – any one of The Gambia, Mali and Tunisia – on Wednesday, 26 January.
The late missed penalty was harsh on Kamara, the 37-year-old who had scored the winner against Benin last June which had secured Sierra Leone’s qualification for the tournament.
Former Norwich City and Middlesbrough man Kamara took the responsibility from 12 yards after Ganet had brought down Issa Kallon, but Owonu launched himself to his left to claw his attempt past the post.
The Leone Stars, making their first appearance at the Nations Cup since 1996, had drawn their first two games against defending champions Algeria and two-time winners Ivory Coast to give themselves a chance of going through.
Yet they struggled to create meaningful chances in Limbe, although Steven Caulker headed across goal and wide just after the hour mark as they sought an equaliser.
Sierra Leone had Kwame Quee sent off late on for a second bookable offence and their result, coupled with Algeria’s 3-1 defeat by Ivory Coast, means Tunisia and debutants Comoros are guaranteed their own spots in the knock-out stages.
Equatoguineans maintain qualification run
Finishing second behind Ivory Coast continues Equatorial Guinea’s proud record of always progressing past the group stage on their appearances at the Nations Cup.
The Nzalang Nacional (National Thunder) were quarter-finalists on their debut as co-hosts in 2012 before finishing fourth three years later as sole organisers.
Micha’s well-organised side had upset Algeria in their second group outing, and Ganet’s first-time strike was a true moment of quality after he was fed by Iban Salvador.
Salvador, industrious throughout, thought he had a chance to seal the match from an injury-time penalty after being brought down by Mohamed Buya Turay as Equatorial Guinea mounted a late counter-attack.
But, following a video assistant referee review, the foul was adjudged to have been just outside the area, and the Fuenlabrada midfielder took the ball to the corner.
Sierra Leone ‘stand by Kamara’
Sierra Leone defender Steven Caulker told BBC Sport Africa:
“Most of us are here because of Kei. He is our ringleader and everything to us.
“We stand by him.
“He scored the penalty to get us here in the first place. And he was brave enough to step up and take this penalty.
“We gave it everything as a team and as a unit. We gave it everything until the end and go away with our heads held high.”