Tsunami warning after massive earthquake hits waters off Indonesia while David Cameron visits the countryTsunami warning issued after 8.7 magnitude quake strikes off Aceh coast .

Fears of repeat of 2004 disaster, which killed 31,000 people in provincePanic in streets as buildings shake for four minutes and people flee to hillsDavid Cameron, visiting 1,600 miles from Aceh, says UK is “ready to help”

Indonesia has issued a tsunami warning after a massive earthquake hit waters off its coast today during a visit there by Prime Minister David Cameron.

The quake, with an 8.7 magnitude, hit waters off Aceh – the same westernmost province that was devastated in 2004 Boxing Day disaster. It was followed by a similar strength aftershock four hours later.

The first quake, which was centred 20 miles beneath the ocean floor around 308 miles from the provincial capital of Banda Aceh, was later thought unlikely to have triggered a fatal wave.

Panic: People in Banda Aceh scramble to ecsape the city after a tsunami warning was issued. There are fears that a tsunami could be as bad as the one on Boxing Day in 2004

Concern: An Acehnese woman with a child tries to stop a car to go to higher ground after tremors are felt

But, worryingly, the aftershock was measured at 8.2 magnitude with an epicentre just a few hundred miles from that of the first quake – and this could yet cause a devastating tsunami.

People in Banda Aceh screamed “God is great!” as they jumped into cars and the backs of motorcycles, clogging streets as they fled to high ground. Buildings shook for four minutes.

There are fears of a repeat of the 9.1-magnitude quake seven years go that triggered a tsunami that killed 230,000 people. Nearly three quarters lived in Aceh, which is on the Sumatra island.

“I was in the shower on the fifth floor of my hotel,” witness Timbang Pangaribuan today told El Shinta radio from the city of Medan.

“We all ran out. … We”re all standing outside now.”

He said one guest was injured when he jumped from the window of his room.

Mr Cameron is visiting the country’s capital, Jakarta, which is 1,600 miles south-east of the province and on a different island, Java. No tremors have been felt there and the city is unlikely to be hit.

Visit: David Cameron talks to Indonesian President Susilo Bambang Yudhoyono after his arrival at the Presidential Palace in Jakarta today

Strike point: The spot where the earthquake hit and bubbles that show where the tsunami is most likely to hit

The epicentre of the quake and circles showing how a tsunami could move outwards. The map also shows the relative positions of Aceh and Jakarta, where Mr Cameron is visiting the country”s president

He told President Susilo Bambang Yudhoyono: ‘Our thoughts should be with those who are affected.

‘Britain of course stands ready to help if help is required.

‘We will stand with you and your government and your people at this time of worry.

Mr Yudhoyono moved to calm nerves, saying that there appeared to be no serious casualties and local residents had been taken to safety.

He added that ‘as of this time there is no threat of tsunami’ – despite an international warning being issued.

He added: ‘The situation is under control so far. It is a very different situation from 2004 when Aceh was faced with a deadly tsunami.’

The tremor was felt in Singapore, Thailand, Bangladesh, Malaysia and India. A tsunami warning has been issued for cities all along the coast of Sumatra.

The Pacific Tsunami Warning Center in Hawaii said a tsunami watch was in effect for Indonesia, India, Sri Lanka, Australia, Myanmar, Thailand, the Maldives and other Indian Ocean islands, Malaysia, Pakistan, Somalia, Oman, Iran, Bangladesh, Kenya, South Africa and Singapore.

Fears: Terrified people run out of their homes in Banda Aceh and prepare to evacuate

Shock: Worried residents of Banda Aceh in the streets

There were also reports of the water level dropping in the Thai resort of Phuket – a sign that the sea is drawing back in preparation to launch an enormous wave.

A tsunami watch means there is the potential for a tsunami, not that one is imminent. Since 2004 such warnings are issued after every earthquake in the Pacific.

Indonesia straddles a series of fault lines that makes the vast island nation prone to volcanic and seismic activity.

Last year”s devastating tsunami in Japan was triggered by an earthquake with a similar hypocentre depth 20 miles below the surface.