Ghana needed a second-half penalty and a late breakaway goal to end Cape Verde's gallant run at the African Nations Cup and book their fourth successive trip to the semi-finals.
Mubarak Wakaso came off the bench to hammer home a 54th minute spot kick - his second of the tournament - to see the Black Stars to a win at the Nelson Mandela Bay Stadium and into the last four again. The second goal came deep in stoppage time on the breakaway, again Wakaso with only an open net in front of him.
It was tough on the islanders, who set up many more opportunities than the Black Stars but whose fairytale run is now over.
They will feel hard done by over the refereeing: Rajinjaprasad Seechurn of Mauritius decided that Carlitos had knocked Asamoah Gyan off the ball in the penalty box in a marginal decision that under different circumstances, and with another official in charge, might not have been given. Wakaso gave Vozinha in the Cape Verde goal no chance.
While Ghana dominated possession, the Cape Verdians created the most chances. But they squandered their opportunity to add another major scalp to an already almost-unbelievable run at the tournament. Cape Verde might have grabbed an early goal in the 13th minute. Clever inter play on the edge of the box stretched the Ghana defence, but Heldon skyed over the crossbar a shot that, had it been on target, might have given the islanders the early lead.
Howver, an otherwise staid opening 45 minutes saw Ghana dominate possession without creating anything substantive.
In the 52nd minute a free kick supplied tall Cape Verde centre half Julio Tavares with a header but there was not enough power to trouble Fatau Daouda in the Ghana goal.
Then came the concession of the penalty, followed quickly by several chances for Cape Verde in the minutes that followed, with both Heldon and Tavares again failing to find the net. Ghana might have sealed it six minutes from the end when Wakaso broke free on a counter-attack but missed.
Then in stoppage time Daouda made a brilliant save from Heldon's free kick to turn the ball around for a corner. Vozinha came forward from his goal to help Cape Verde try and snatch an dramatic late equaliser. But he was caught out of position on the counter as Wakaso sprinted away, when the ball was cleared, to score the second.
Ghana now play either Burkina Faso or Togo in Wednesday's semi-final in Nelspruit.