Allen Nono (12) scored Gabon's winner to take them to success against Morocco
Gabon has won their first ever continental title, with a 2-1 victory over Morocco in the final of the African U23 Championship, reports the BBC.
Both teams had already qualified for the Olympic Games, so Saturday's match was all about the U23 crown.
All the goals came in the first half and the match became increasingly bad tempered as Gabon wasted time late on.
The victory will be a major boost to Gabon, who co-host the Africa Cup of Nations in January next year.
Each side had a man sent off, although Gabon's red card was in stoppage time at the end of the game.
Morocco opened the scoring on 22 minutes when Younes Mokhtar fired home an angled shot into the bottom right hand corner of the Gabonese goal.
15 minutes later Gabon, who has surprised many with their achievements in Morocco, was level thanks to a powerful strike into the roof of the net from Landri Obiang Obiang.
And just before the break, Allen Nono headed home a free-kick to put the underdogs in front and silence the vociferous home crowd, who had finally turned out in numbers.
The second-half was a much more niggly affair, and Morocco's cause was badly damaged when their goalkeeper, Younes El Kharroubi, was sent off for a challenge on Nono outside the area.
Gabon had chances to extend their lead after that but could not find another way through - instead they had Didier Ndong sent off late on.
Both he and El Kharroubi may miss the first match at the London Games because of their red cards.
Earlier, Egypt claimed the final automatic African qualifying place for the London 2012 Olympic Games.
They beat Senegal 2-0 in the third place play-off match at the African U23 Championship to take their spot.
Africa's Olympic Qualifiers
Gabon - champions
Morocco - runners-up
Egypt - third place
Senegal face a play-off with an Asian team to decide if they will go to London