"The total death toll now is 3,002," Direvan, an official at the social affairs ministry's disaster task force in Jakarta, said.

The International Red Cross said that some 200,000 people have been displaced by the massive earthquake.

Witnesses said the brunt of the quake was borne by Yogyakarta, an ancient royal city, near Mount Merapi, a volcano that has been on alert for a large eruption this month. A vulcanologist in Yogyakarta said the quake was tectonic and not caused by the volcano, but said it had increased Merapi's activity.

As darkness fell, thousands prepared to spend the night outside ruined homes or in the grounds of mosques, churches and schools.   

Residents try to free a car

"It's pitch dark. We have to use candles and we are sitting outside now. We are too scared to sleep inside. The radio keeps saying there will be more quakes. We still feel the tremors," said Tjut Nariman, who lives on the outskirts of Yogyakarta.

Tsunami fears

The 6.2 magnitude quake struck just after dawn and was the third major tremor to devastate Indonesia in 18 months, the worst being the quake on December 26, 2004 and its resulting tsunami which left some 170,000 people dead or missing around Aceh.

The epicentre of the quake, which struck just before 6am (2300 GMT), was offshore. Many people feared the quake would be followed by a tsunami and fled coastal homes for higher ground.

No tsunami came but the fear lingered on into the night.

Many thousands of people have been injured and medical facilities were quickly overwhelmed.

Witnesses said hundreds of houses had collapsed in the quake. Office and government buildings were also in ruins.

Many buildings have collapsed

Hospital patients had been moved outside due to fears of aftershocks.

Thousands of residents were taking refuge in Yogyakarta's main square while thousands of others were sheltering at compounds of scores of mosques, churches and hospitals throughout the region.

Yogyakarta is about 25km north of the Indian Ocean coast.

A witness in Yogyakarta said many people there had fled their homes while thousands of others from areas around the city were trying to evacuate to it, many fearing a tsunami.

Dizzy

One Yogyakarta resident, Nani Kasidjo, said: "I was having a morning walk and suddenly I felt dizzy and then people ran out of their houses screaming 'Earthquake!'."

Indonesia's national airline, Garuda, said Yogyakarta's airport was closed.

Roads leading to the coast were cracked and electricity was off, witnesses said.