Death toll from a powerful earthquake that devastated a string of mountainous towns in central Italy on Wednesday has risen to at least 38.

The quake trapped residents under piles of rubble and left thousands homeless.

The quake struck in the early hours of the morning when most residents were asleep, razing homes and buckling roads in a cluster of communities some 140 km east of Rome.

A family of four, including two boys aged 8 months and 9 years, were buried when their house in Accumoli imploded.

As rescue workers carried away the body of the infant, carefully covered by a small blanket, the children’s grandmother blamed God: “He took them all at once,” she wailed.

The army was mobilised to help with special heavy equipment and the treasury released 235 million euros of emergency funds.

At the Vatican, Pope Francis cancelled part of his general audience to pray for the victims.

Aerial photographs showed whole areas of Amatrice, voted last year as one of Italy’s most beautiful historic towns, flattened by the 6.2 magnitude quake.

“It’s all young people here, it’s holiday season, the town festival was to have been held the day after tomorrow so lots of people came for that,” said Amatrice resident Giancarlo, sitting in the road wearing just his underwear.

“It’s terrible, I’m 65-years-old and I have never experienced anything like this, small tremors, yes, but nothing this big. This is a catastrophe,” he said.

Accumoli mayor Stefano Petrucci said some 2,500 were left homeless in the local community, which is made up of 17 hamlets.

Residents responding to wails muffled by tonnes of bricks and mortar sifted through the rubble with their bare hands before emergency services arrived with earth-moving equipment and sniffer dogs.

Wide cracks had appeared like open wounds on the buildings that were still standing.

The national Civil Protection Department said some survivors would be put up elsewhere in central Italy, while others would be housed in tents that were being dispatched to the area.

Italian Prime Minister Matteo Renzi said he would visit the disaster area later in the day.

“No one will be left alone, no family, no community, no neighbourhood. We must get down to work … to restore hope to this area which has been so badly hit,” he said in a brief televised address.

The quake hit during the summer when the area, usually sparsely populated, hosts large numbers of holidaymakers.

A spokeswoman for the civil protection department, Immacolata Postiglione, said the dead were in Amatrice, Accumoli and other villages including Pescara del Tronto and Arquata del Tronto.

She put the initial death toll at 38, but said rescue teams had only just reached some stricken areas.

The earthquake caused damage in three regions – Umbria, Lazio and Marche – and was felt as far away as the southern Italian port city of Naples.

The hospital in Amatrice was among the buildings that were badly damaged, and patients were moved into the streets.

“Three quarters of the town is not there anymore. The aim now is to save as many lives as possible. There are voices under the rubble, we have to save the people there,” Amatrice mayor Sergio Pirozzi told state broadcaster RAI.

RAI reported that two Afghan girls, believed to be asylum-seekers, were also missing in the town.

The U.S. Geological Survey, which measured the quake at 6.2 magnitude, said it struck near the Umbrian city of Norcia, while Italy’s earthquake institute INGV registered it at 6.0 and put the epicentre further south, closer to Accumoli and Amatrice.

The damage was made more severe because the epicentre was at a relatively shallow 4km below the surface of the earth.