An improved performance from Ghana saw them progress to the quarter-finals as the top team in Group A, with a dismal showing from Morocco.
Essien scored a delightful goal after Muntari chipped to him
The two goals came in the first half and were the result of moves involving Michael Essien and Sulley Muntari.
Muntari chipped a free-kick over the wall to Essien, who swept the ball in to make it 1-0 after 26 minutes.
Essien's pass on the stroke of half-time set up a left-footed Muntari shot for the second and decisive goal.
As much as the victory boosted the mood of fans, the Black Stars may have to raise their game further if they are to prevail in the knock-out stage.
The match began at a lively pace with both sides creating chances.
On 15 minutes Muntari fired in a free-kick from 30 yards that was heading for the top-right corner but was parried away by goalkeeper Nadir Lamyaghri.
But Ghana were playing like a team nervous and under pressure, with signs of edginess.
That changed in the 26th minute when the Black Stars went ahead with a gem of a goal.
Muntari, well-known for his ability to score from long-range, took a free-kick from 30 yards out.
Morocco were expecting a shot at goal, but Muntari put the ball over the wall, with Essien beginning a run down the right into the box.
The Chelsea midfielder put it into the back of the net with a first-time shot.
With much criticism from supporters after two unconvincing wins, it was a goal that Ghana desperately needed, and the atmosphere in the stadium was lifted.
Morocco had the ball in the back of the net three minutes later when Ghana defender John Paintsil headed Hicham Aboucherouane's free-kick into his own net, but the goal was not given.
Ghana's second came on 45 minutes, when Essien ran with the ball from the half-way line and laid it on his left to Muntari, who who finished with his left foot.
But Morocco goalkeeper Lamyaghri, having his first game of the tournament could have done better.
Morocco made far too many unforced errors and played without direction - far below the level that they are capable of.
Ghana's pace dropped in the first 20 minutes of the second half, then a long-range shot from Essien sped just over the bar.
There was a lively end to game for Ghana, with Asamoah Gyan, Essien, Junior Agogo, Quincy Owusu-Abeyie and Muntari all coming close.
Unlike the previous game when he was booed off the pitch, Gyan received warm applause when he was stretchered off and substituted.
Morocco managed only one shot on target in the second half, a woeful end to their tournament, which began with a 5-1 thrashing of Namibia.
The game kicked-off with the Ohene Djan stadium half-full, but more fans came in during the first half.
Mexican waves later went around a near full-house as the Black Stars marched to the quarter-finals.
Ghana: Kingson, Sarpei, Addo, Pantsil, Mensah, Gyan (Baffour 88), Annan, Essien, Muntari, Quincy (Draman 89), Agogo (Ayew 83).
Subs Not Used: Barusso, Adjei, Asare, Afful, Alhassan, Asamoah, Dauda, Kingston, Kumordzi.
Goals: Essien 26, Muntari 45.
Morocco: Lamyaghri, Chretien, El Kaddouri, Ouaddou, Erbate, Kharja (Sektioui 46), Safri, Kabous (Kissi 90), Hadji, Aboucherouane (Zerka 55), Chamakh.
Subs Not Used: Fouhami, Bagui, Alioui, Chahiri, El Karkouri, El-Moubarki, Alloudi, Mahdoufi, Mokhtari.
Booked: Erbate, Kabous.
Ref: Modou Sowe (Gambia).