The Ghanaians enjoyed the better of the early stages and they were rewarded on 19 minutes when Kennedy Ashia's powerful strike found the net.
However, they levelled the contest on 71 minutes thanks to Thiago Ferreira after Ghana had failed to clear their lines from a free kick.
Portugal then turned the match around moments later as Edgar Ie rose highest to head in a corner.
No sooner had the Portuguese got themselves in front that Michael Anaba made it 2-2 with a calm finish from 10 yards.
More drama was to follow in the 85th minute as Yiadom Boakye's free kick earned Ghana a thrilling victory.