Many chose to stay outside for fear of aftershocks or to be near their homes
Thousands of people have spent the night outdoors in the southern Spanish town of Lorca after an earthquake which killed at least eight people.
The magnitude-5.2 tremor toppled several buildings after striking at a depth of just 10km (six miles), 120km south-west of Alicante.
Lines of cars lay crushed under tonnes of rubble after Spain's worst earthquake for 50 years.
Wednesday evening's quake came about two hours after a 4.4-magnitude tremor.
Regional officials on Thursday put the official death toll at eight, revising it down from 10. It is not clear how many people were injured, although Spanish media say there are dozens with some in a critical condition.
Military deployed Shocked residents and workers rushed out of buildings and gathered in squares, parks and open spaces after the quake struck at 1847 (1647 GMT) in the town in Murcia region.
Old buildings were badly damaged.
Spanish TV captured dramatic images of a church bell tower crashing to the ground, landing just metres from a cameraman.
As night fell, many of Lorca's 90,000 residents were either unable or still too afraid to return to their homes.
Mayor Francisco Jodar said as many as a third of the population slept out.
The Red Cross had set up a temporary shelter with 800 beds on the edge of town, but many people preferred to "sleep outside" to be near their homes or for fear of aftershocks, spokeswoman Carla Vera said.
Many people spent the night huddled under blankets in parks and other open spaces including an outdoor basketball court and playgrounds.
"We know we live near a fault line but we never thought this would happen," Lorca resident Pepe Tomas, 56, said.
"People are afraid. No-one here has ever seen anything like this before."
Ms Vera said the Red Cross has moved in 24 ambulances and set up three ambulances.
The interior ministry says 225 emergency military units and 400 workers, including rescuers with dogs, have been sent to Lorca.
Some 350 ambulances have transferred 400 patients out of two of the town's hospitals, the regional government said.
Spain has hundreds of earthquakes every year but most of them are too small to be noticed.
Murcia is the country's most seismically active area and suffered tremors in 2005 and 1999. It is close to the large faultline beneath the Mediterranean Sea where the European and African continents meet.