MEXICO CITY: A church roof collapsed during Sunday mass in a northern Mexican city killing at least nine people and injuring 40, authorities said, as rescuers worked into the night, desperately looking for another 30 people believed to be trapped under the rubble.

Working under floodlights, military personnel supported emergency services using rescue dogs and earth moving equipment to identify and dig out survivors from the ruins of the church in Ciudad Madero, a city on the Gulf coast near the port of Tampico.

Footage on social media showed the moment the church roof caved in, puffs of gray smoke billowing into the air, followed by the toppling of yellow brick outer walls.

Nine people died and another 40 were taken to nearby hospitals, while 30 other worshippers remained unaccounted for, Jorge Cuéllar, spokesman for the Security Ministry of Tamaulipas state, which borders Texas.

Speaking on Foro TV news channel, Cuéllar thanked local businessmen for bringing equipment to help remove rubble and aid rescue efforts.

Bishop Jose Armando Alvarez from the Roman Catholic Diocese of Tampico said the church roof crumbled as worshippers were receiving communion and asked others to pray for the survivors.

"In this moment the necessary work is being carried out to pull out the people who are still under the rumble," Bishop Armando said in a recorded message shared on social media.