There was a serious lack of quality in the opening 65 minutes with both sides unable to break the deadlock.
But the game burst into life when Cristiano Ronaldo notched the opener.
The Portugal superstar won a penalty, brushed himself down and then dispatched his spot-kick into the net.
Ghana fought back and restored parity shortly after through Andre Ayew.
Goals from Joao Felix and Rafael Leao gave Portugal a two-goal lead, but Osman Bukari’s 89th minute effort set up a grandstand finish.
It was all in vain for Ghana, though, as Portugal survived a crazy last few minutes to hold on to all three points.
Ayew’s brilliant reaction to Felix’s goal
Ayew scored the first goal by an African nation at this World Cup in the 73rd minute.
But, despite getting on the scoresheet, he was substituted off minutes later as he made way for his brother, Jordan.
Moments later, Felix broke clear and made it 2-1 to Portugal.
The cameras then panned to Ayew. The 32-year-old was still celebrating his goal with his teammates as Felix scored.
When the Atletico Madrid forward scored to give his side the lead once more, Ayew turned around and could not believe his eyes.
It made for an amusing moment and you can view it below…
VIDEO: Ayew was still celebrating his goal when Felix scored
Ayew was celebrating on the bench then Felix scores mid way of his celebration 😂 pic.twitter.com/1YuELtw9dl
— 🇨🇩🇸🇱 (@8Flavs) November 24, 2022
📸 – Ayew was still celebrating with his teammates from the bench as Joao Felix scored. pic.twitter.com/o0m6bvZRP4
— 𝐀𝐅𝐂 𝐀𝐉𝐀𝐗 💎 (@TheEuropeanLad) November 24, 2022
Many football fans are laughing at Ayew’s actions and you can view some reaction below…
Portugal take control in Group H
Portugal’s hard-fought victory means they have gone to the summit of Group H.
The other game in the group ended goalless between Uruguay and South Korea.
Portugal are next in action when they take on Uruguay on Monday. A win will see them secure their progression to the next round.
Ghana face South Korea in a must-win game for the African outfit.
You can find all the latest football news and rumours right here: