Libreville - Vincent Aboubakar came off the bench to score a stunning winner with two minutes left as Cameroon fought back to beat Egypt 2-1 in a thrilling Africa Cup of Nations final on Sunday.
Arsenal midfielder Mohamed Elneny had given Egypt the lead midway through the first half and Egypt looked to be on course to win an unrivalled eighth Cup of Nations crown in their first appearance at the tournament since 2010.
But Nicolas Nkoulou, who had come off the bench in the first half, headed in the equaliser just before the hour mark and fellow substitute Aboubakar slammed in the winner in the 88th minute.
That sparked bedlam in a near-capacity crowd of more than 38,000 in Gabon's capital, made up in its majority by Cameroonian supporters.
It is a fifth Cup of Nations crown for the Indomitable Lions, a first since 2002, and the first time they have beaten Egypt in the final in three attempts.
"I am very happy that we won the Cup of Nations today and I am happy for the players -- this is not a group of football players, they are a group of friends," said Cameroon's Belgian coach Hugo Broos.
Egypt fell just short on their return to the competition after a seven-year absence, and the defeat will be especially painful for their coach Hector Cuper.
The Argentine was desperate to win a trophy after a career tainted by rotten luck in finals at club level, including back-to-back defeats in the UEFA Champions League with Valencia at the start of the last decade.
But Cuper said: "The sadness I have is not because I lost another final, it's because there was so much hope especially among the people in Egypt and I am sorry for the players who put in so much effort."
Egypt have been derided at times for a defensive approach under Cuper, but they played their part in this rarest of things -- a genuinely entertaining final.
The Pharaohs had signalled their intent within two minutes as a delightful cushioned pass by Mohamed Salah set up Abdallah El Said, but his firm shot was well held by Fabrice Ondoa in the Cameroon goal.
Egypt then opened the scoring midway through the first period with a superb team goal.
Amr Warda and Salah combined on the right and the latter played the ball into Elneny in space in the area, the midfielder taking a touch to control and another to steady himself before blasting high past Ondoa at his near post.
It was a brilliant finish from the midfielder who was returning to the side after missing his team's last two games due to a calf injury.
The odds were now very much against Cameroon.
The last Cup of Nations final to feature more than a single goal came in 2004, when Tunisia beat Morocco 2-1. The last time a side came from behind to win the trophy was in 1994, when Nigeria beat Zambia 2-1.
Hugo Broos's side also lost centre-back Adolphe Teikeu to an apparent groin injury just after the half-hour mark, with Nkoulou taking his place.
The Lyon defender has been out of favour at this tournament, only starting in Cameroon's final group game against Gabon. But thrown on here through necessity, it was he who pulled his side level in the 59th minute.
Egypt failed to fully clear their lines following a corner and captain Benjamin Moukandjo crossed from the left for Nkoulou, who soared above Ahmed Hegazy to head past Essam El Hadary from six yards.
Cameroon were revitalised by that goal, a partisan crowd lifted, but Jacques Zoua fired wastefully wide and Moukandjo blasted over from an excellent position as extra time began to seem inevitable.
Then Aboubakar, who had been introduced at the start of the second half, controlled a long ball forward with his chest on the edge of the area, poked it over the head of Ali Gabr and volleyed low past El Hadary.