Appearing in its fourth AFCON, Namibia had failed to win any of its previous nine finals matches, losing seven and drawing two.
However, the southern African nation, ranked 115th in the world and 87 places below Tunisia, was a deserving winner as midfielder Deon Hotto made himself the hero with an 88th-minute winner.
Hotto’s header sparked wild scenes on the Namibia bench and in the stands, as 33-year-old leapt over the advertising hoardings to celebrate his goal in front of an ecstatic group of fans.
Tunisia, the 2004 AFCON champion, is the No. 1 seed in Group E but now faces a tricky path to reach the knockout stages, with Mali and South Africa still to play.
Next up for Tunisia is a difficult tie against No. 2 seed Mali, with anything less than a victory likely plunging its qualification into doubt, while a buoyant Namibia faces South Africa.
For more CNN news and newsletters create an account at CNN.com