In this photo released by the Moroccan Royal Palace, King Mohammed VI of Morocco, accompanied by Crown Prince Moulay El Hassan, left, listens to civil defense Gen., Abdelkrim El Yaccoubi, right, as he inspects a residential building which collapsed in Casablanca, Morocco, Friday, July 11, 2014. Three buildings partially collapsed for unknown reasons killing two people and wounding at least 50 others. (AP Photo/Azzouz Boukallouch, Royal Palace)

Casablanca, Morocco - At least four people including a 10-year-old child died on Friday and 55 others were injured when three residential buildings collapsed in Casablanca, Morocco's largest city, the authorities said.

The three apartment blocks in El-Hank district collapsed at around 0230 GMT, and the bodies of four people were pulled from the rubble during the day, state media cited officials as saying.

In addition to the child, a woman in her 40s was also among the dead.

Firemen rescued at least 55 people injured in the accident, including six children, and the search for a dozen missing residents continued during the afternoon, an AFP journalist reported.

King Mohamed VI, who happened to be in the city on Friday, visited the scene and the injured in hospital.

A palace statement afterwards said that the local authorities had been instructed to find temporary accommodation for those affected.

The immediate cause of the accident was not known.

But residents questioned by AFP said it probably resulted from “haphazard works” on the lower floors of the buildings, as well as a general lack of maintenance that is common in the area.

Casablanca is Morocco's economic capital, with a population of around five million.

But many of its inhabitants live in squalid conditions, notably in sprawling slums, and people living in some of the older apartment blocks are exposed to serious safety hazards.

Two people died at the end of 2012 when a building came down after bad weather.

The housing minister said at the time that between 4 000 and 7 000 buildings in the city were at risk of collapse.