Uganda vs Namibia on Thursday night was the only game to save the Cranes to stay in CHAN 2018 tournament taking place in Morocco.
However, things did not turn out well on Cranes side after losing the only hopeful game to Namibia's Brave Warriors in Group B by 1-0.
Uganda's last group match against Ivory Coast on Monday will only be a formality. With six points in the bag each, Zambia and Namibia are through to the quarter-final stage of the competition that features only home-based players.
Coach Sébastien Desabre's side was two minutes away from picking up a crucial point that would keep The Cranes still in contention by a feather, but a 91st-minute strike by Namibia's Panduleni Nekundi crashed the Ugandans.
Desabre's men were short of the incisiveness and precision they needed to penetrate the Nambian lanky defence. Besides, the Warriors gave away a tad too many freekicks, which affected the flow of the game.
Sadam Juma's powerful first-half freekick floated inches over the crossbar, before Hendrick Somaeb's burst forward past Cranes skipper Bernard Muwanga on the other end of the pitch nearly gifted the Namibians a lead, with returning first-choice keeper Ismael Watenga committed out of goal.
Watenga replaced Benjamin Ochan between the goal posts after completing his suspension, having had to sit out the opener against Zambia.
Uganda came close to taking a lead to the break, but Muzamiru Mutyaba's determined surge into the area was dealt with tactfully by Ferdinand Karongee.
After restart, Derrick Nsibambi, the scorer of Uganda's only goal at this edition, went tumbling down inside the area, but any alarms for a penalty were swiftly muted by the already raised official's flag across the field.
The tenacious KCCA FC forward will certainly rue his missed opportunities in a game that so needed his brilliance. One moment illustrating his profligacy was in the 53rd minute, when Kalisa made a characteristically spirited run on the right flank, delivered a delicious low cross in, but Nsibambi failed to connect past Kazapua.
It was a timely save by the goalstopper, yet a perfect missed chance by a player of Nsibambi's standards. He was again guilty of wastefulness 24 minutes to time. He did well to shake off his tumbling minder, but an attempt to curl the ball low with his right foot only did well to escape both the keeper and the goal mouth - by inches.
Both sides made reforms later on, but possibly the biggest talking point, as well as the game changer of the contest, came in the 75th minute when Egyptian referee Ibrahim Nour El Din showed Awanyi a second yellow and then a red card after the Ugandan appeared to have headbutted an offensive striker mid-flight.
But was it a harsh decision?
Replays showed Awanyi challenging for the ball, before clashing with his opponent. However, the 'victim' did not stay down rolling on the surface in pain. Instead, he quickly sprang to his feet albeit wearing an expression of displeasure over the challenge.
The Ugandan camp will have felt a sense of injustice with the referee's decision.
Ten-man Cranes held on, with the Namibians pressing more. But the latter's numerical advantage eventually told, when Nekundi struck late on to all but book Namibia a place in the last-eight.
Uganda will play Ivory Coast in the last group game on Monday while Zambia will face off with Namibia the same day to determine the winner of Group B.