African Cup of Nations - Stars see Ghana through
Morocco went into the match knowing only victory would ensure qualification, but conceded two first-half goals when Chelsea's Michael Essien and Portsmouth's Sulley Muntari twice combined.
The result means Ghana go through as group winners with Guinea second, Ghana facing either Nigeria or Mali in the quarter-final in Accra. Morocco fail to qualify, with French coach Henri Michel's position immediately under threat after a disappointing tournament.
Ghana were much improved from their performances in their opening two matches, although the long grass at the Accra Sports Stadium was again far from conducive to their strong-running style.
Muntari went close after 16 minutes with a fierce free-kick from 35 yards, Morocco keeper Nadir Lamyaghri reacting late before recovering to dive and paw the ball clear from the top corner.
When Ghana were awarded a free-kick in a similar position 10 minutes later, it seemed Muntari would crash another effort goalwards - but the midfielder cleverly picked out the run of Essien with a neat chip, and the Chelsea man put the hosts up with a low volley on the turn.
Morocco were unfortunate not to equalise when they saw an effort chalked off, John Pantsil bundling an inswinging cross into his own net only for the referee to award a free-kick for a non-existant foul.
And the Black Stars capitalised on the space Morocco were leaving at the back with a second just before the break as Essien and Muntari brilliantly combined again, the Portsmouth man controlling Essien's flicked pass after a strong run before firing a deflected shot past the keeper at the near post.
Predictably, Ghana were strong on the counter-attack after the break as Morocco tried in vain to find a way back into the match, Nottingham Forest's Junior Agogo clipping the crossbar with an attempted cross ten minutes into the second period.
Asamoah Gyan - under-fire from Ghana fans after a series of lacklustre performances - should have done better with another break down the left channel, showing surprising indecision as he cut into the box, and Essien flashed another long-range shot over the crossbar on the hour.
Morocco keeper Lamyaghri made two excellent saves in the space of 60 seconds in the final quarter of the game, first keeping out Gyan's near-post header with an instinctive arm before tipping another Essien effort over for a corner.
And the keeper had to again be alert to save from the impressive Agogo in the final ten minutes as Ghana pressed for a deserved third.