LAGOS - At least eight children have died and many more are feared trapped after a building containing a school collapsed in the Nigerian city of Lagos.

The school, which was on the top floor of the three-storey building in Ita Faji on Lagos Island, had more than 100 pupils, a rescue official told the BBC.

About 40 pupils were pulled out alive, the official said. Rescuers were frantically searching for more.

The cause of the collapse was not immediately clear.

The collapsed building was a residential block containing a number of apartments as well as the school, residents and rescue officials at the scene told the BBC.

Emergency teams pulled several injured pupils from the rubble, but many worried parents at the scene were unable to find their children, while others went to a local hospital to look for theirs.

Men from the local area were assisting rescuers but large crowds of people were hindering the rescue operation.

Mohammed Muftau, a local resident who witnessed the collapse, told the BBC that the building had been cracking for long time and that compl aints had been raised about it.

At the Lagos Island General Hospital, there was a scene of chaos as parents and family members scrambled after every ambulance that arrived to see if it contained a loved one. Many of the victims brought in were children in school uniforms.

At the hospital, Idiat Oluranti Adebule, the Lagos state deputy governor, offered condolences to the families of the victims and called for calm.

“We plead for their understanding to allow the rescue team to do their work... so that the medical team can take prompt and immediate action as soon as the patients are brought in,” she told the BBC.

Ibrahim Farinloye, a spokesman for the National Emergency Management Agency, said the collapse had happened at about 10:00 local time (09:00 GMT).

“It is believed that many people including children are currently trapped in the building,” he said.

It is not unusual for buildings to collapse in Nigeria. Materials are often sub-standard and the enforcement of regulations lax.

In 2016, more than 100 people died when the roof of a church in Uyo, in the south of Nigeria, caved in.