(Reuters) - A strong earthquake felt all the way across Northern Italy killed at least five people, injured dozens and damaged churches, towers and a medieval castle early on Sunday, waking terrified citizens and sending thousands running into the streets.

The quake, which the U.S. Geological Survey recorded at magnitude 6.0, struck at 4:04 a.m. (0204 GMT) and was followed by a series of jolting aftershocks.

I am 83 and I have never felt anything like this, said Lina Gardenghi, a resident of Bondeno.

The epicenter of the quake, the strongest to hit Italy in three years, was in the plains near Modena in the Emilia-Romagna region of the Po River valley, and the tremor was felt as far west as Liguria, bordering France, and the Friuli region bordering Slovenia.

Emergency service chief Franco Gabrielli said the death toll included five people killed directly by the quake and another who suffered a heart attack because of it. Officials said up to 3,000 people would not be able to return to their homes for the time being. 

Prime Minister Mario Monti cut short his trip to the United States and said the cabinet would declare a state of emergency, freeing up funds for quake relief. 

Among the dead was a woman of 106, killed in her bed by a falling roofbeam at her house in the countryside. 

The quake seriously damaged many historic churches and other buildings, adding up to the greatest loss to Italy's artistic patrimony since an earthquake in 1997 damaged the Basilica of St Francis in Assisi, whose ceiling collapsed.

The massive, imposing 14th century Estense Castle, the symbol of the town of San Felice Sul Panaro and its most important building, was severely damaged.

The tops of several of the smaller towers collapsed and there were fears that the main tower, weakened by cracks, could tumble down. Three of the town's churches were severely hit, damaging centuries-old frescoes and other works of art.

We have practically lost all our artistic patrimony, said Alberto Silvestri, mayor of San Felice Sul Panaro. Churches and towers collapsed. The theatre is still standing but has cracks.

The quake left a gaping hole and gashes in the side of the Sant' Agostino's Renaissance town hall, which officials said was in danger of total collapse. The town's streets were strewn with rubble and the stench of gas filled the town and raised fears of explosions.

In Bondeno, a Moroccan man working a night shift in a polyester factory died when he was hit by falling debris.

A 57-year-old Italian was killed when part of an ironworks in Sant' Agostino collapsed, and two men were killed in the same town when part of a ceramics factory collapsed. He wasn't supposed to be there. He changed shifts with a friend who wanted to go to the beach, the mother of one of the victims said.

Pope Benedict prayed for the victims in his Sunday address at the Vatican.

A series of strong aftershocks hit the area, the most violent having a magnitude of 5.1. Mayors ordered residents to stay outdoors pending checks by structural engineers and began preparations to house those who could not return to their homes.

Two other people, one of them a German woman, were reported to have died after suffering heart attacks because of the quake, and several dozen people suffered minor injuries.

Rescue officials were checking reports that other people were buried under rubble and were preparing to house people whose dwellings had been damaged or destroyed.

I was woken at around 4 a.m. by the quake, it was strong and lasted up to a minute, maybe more, Frankie Thompson, a British travel journalist in Bologna, told the BBC.

Church bells were set off spontaneously... followed by an eerie silence. Small aftershocks kept coming and going until maybe 5:50 a.m. when a stronger tremor shook us again but not as long and dramatic as the first, she added.

The quake also shook the cities of Bologna, Modena, Ferrara, Rovigo, Verona and Mantua. No serious damage was reported in the larger, heavily populated towns and cities.

A series of strong aftershocks hit the area, the strongest measuring 5.1, and local authorities ordered residents to stay out of doors.

The quake was centred 22 miles (35 km) north-northwest of Bologna at a relatively shallow depth of 6.3 miles (10 km), the U.S. Geological Survey said.

The last major earthquake to hit Italy was a 6.3 magnitude quake in the central Italian city of L'Aquila in 2009, which killed nearly 300 people.

After that quake, then-Prime Minister Silvio Berlusconi moved a G8 meeting that was to have been held in Sardinia to near L'Aquila as a show of solidarity with the victims.

(Additional reporting by Steve Scherer in Rome, writing by Philip Pullella; Editing by Tim Pearce)