Libya ended a 30-year wait for an Africa Cup of Nations finals win as they defeated Senegal 2-1 their Group A clash in Bata on Sunday night, but still bow out of the 2012 competition.
The North Africans needed a victory, then for co-hosts Equatorial Guinea to beat Zambia. They got their part of the equation right, but Equatorial Guinea could not.
Two goals from Ihab Albousaifi, either side of a Deme N'Diaye strike for Senegal, gave Libya the spoils in a game that will no doubt be forgotten quickly outside of that country.
It was a stop-start affair that was not well controlled by Mauritian referee Seechurn Rajindraparsad, who kept his cards in his pocket for too long, leading to repeated fouls breaking the rhythm of the match.
Libya were ahead inside five minutes as Ahmed Sa'ad Osman showed good trickery on the edge of the box and slipped a through-ball into the path of Albusaifi, who provided a neat finish.
The lead lasted just six minutes though, as a corner from Mamadou Niang was headed home by N'Diaye after some poor marking at the set-piece by the Libyan defence.
At that stage it looked as though the game might be a thriller, but it descended into a test of the referee's lung capacity as he blew, blew and blew some more on his whistle.
The only other chance of note in the first half came when Niang got the faintest of touches on a goalward bound header to elude goalkeeper Samir Abboud, but Mohamed Esnani was on hand to clear off the line.
The second half was more of the same, with Pappis Cisse narrowly failing to find the target with a chip from 35 yards.
The winning goal arrived on 84 minutes and it should be no surprise that it came from an error.
Bouya M'Bengue failed to get the ball clear with his header and Ahmed Zuway cushioned a cross for Albousaifi to volley home. It was a fine finish from the 26-year-old.
Senegal thought they had equalised just a minute later as Cisse's shot was parried by Abboud into the path of Souleymane Camara, who rifled the ball home. However, he was in an offside position when the initial shot came in and the flag was correctly raised.
So Libya are left to celebrate a win, their first since beating Zambia in the semi-finals of the 1982 Nations Cup, while Senegal have a lot of soul-searching to do as they look towards the 2013 competition in South Africa.