Gabon captain Daniel Cousin (centre) collides with Zambia goalkeeper Kennedy Mweene
Zambia qualified for the quarter-finals of the Africa Cup of Nations with a confident victory over Gabon.
Rainford Kalaba opened the scoring with a deft chip over Gabon keeper Ebang Ovono, before James Chamanga made it two in the second half.
Substitute Fabrice Do Marcolino scored late on for Gabon but it was not enough to see them through in a tight group.
Gabon will be bitterly disappointed after needing only a draw to progress, but Zambia deserved their victory.
It means Zambia have come from bottom of the group to qualify as its winners.
The contest against Gabon got off to a cagey start, with most of the action confined to the centre of the park.
But Zambia seemed to settle on the ball quicker and began taking control.
And as early as the eighth minute, Jacob Mulenga should have at least hit the target after some good work down the left by Felix Katongo, but instead he found the side netting.
Zambia continued to threaten with Chris Katongo's free kick causing problems for the Gabonese defence.
Zambia coach Herve Renard has steered his team into the quarter finals
Down at the other end Hull striker Daniel Cousin also hit the side netting after a short pass from Zita Mbanangoye in a packed Zambian penalty box.
But Zambia's hard work eventually paid off after Cousin fouled Chris Katongo near the circle.
Cousin was booked and the resulting free kick was met by Kalaba who chipped the ball over an on-rushing Ovono.
Zambia continued to press for a second but goalkeeper Kennedy Mweene had to be alert to rush out and save from the edge of his penalty area from Roguy Meye.
The Chipolopolo were doing a good job of closing Gabon down and not allowing them to string passes together.
But as the half came to a close, Gabon tried to raise their game.
They began the second half as they ended the first trying to create a decent chance for the largely ineffective Cousin.
But the Zambians rode the pressure and began to press for a second.
And it came from James Chamanga who tapped in from Jacob Mulenga's excellent cross in the 62nd minute.
Chris Katongo could have put the game beyond doubt but fired over the bar from just inside the box.
Both sides were creating half chances but the Zambian defence failed to close down substitute Marcolino in the box and he volleyed in from about six yards in the 83rd minute.
The goal seemed to galvanise the Gabonese as they looked for the equaliser that would see them through to the quarter finals.
The Zambian defence too was beginning to look shaky conceding three corner kicks in quick succession.
Zambia held on for a famous victory but it comes at a price , as yellow cards for Kalaba and centre-half Kampamba Chintu means they will both miss the quarter final game against Nigeria on Monday.
Coach Renard praised his team saying they had proved many people wrong.
"People were laughing at our chances and all the betting had us as the worst team here," said the Frenchman.
"But today we proved we are good enough."
Gabon celebrated at the final whistle after being told they had qualified but news soon came through that they hadn't.
"We thought we had qualified but then they told us no. It is heartbreaking but this is what sport is all about," said Cousin.
Bookmark with:
What are these?