Updated

Tsunamis swamped towns in northwestern Indonesia close to the epicenter of Sunday's undersea earthquake, killing at least 4,185 people and leaving bodies wedged in trees as waters receded, the health ministry said.

Most of the death and destruction occurred in the province of Aceh (search), which lies on the northern tip of Sumatra Island (search). At least 83 people were killed in north Sumatra province and on the island of Nias, to the west of Sumatra close to the epicenter of the 8.9 magnitude quake.

Communication links to several regions in Aceh were still cut off some 16 hours after the quake struck, raising fears that the death toll would rise further.

At least 50,000 people had fled their homes and taken refuge in government offices or other buildings on higher ground, said north Aceh district head Alam Syah. Hundreds were still unaccounted for, officials said.

The corpses of at least six children were laid on stretchers in morgues at one hospital in the northern Acehnese city of Lhokseumawe, witnesses said.

Local Metro TV station showed a screaming mother hugging and kissing her dead child, and panicked residents running through the streets of Lhokseumawe.

Health ministry official Pitoyo said 4,102 people had died in Aceh province, and 83 on Nias and in north Sumatra province.

"We are still waiting for more numbers," said Pitoyo, who goes by a single name. "It will surely rise."

Some 1,400 people were killed in the Aceh provincial capital, Banda Aceh, either in flooding or by quake damage.

The earthquake — the most powerful in 40 years — triggered massive tsunamis that slammed into coastlines across Asia, killing more than 11,300 people in Sri Lanka, Indonesia, India, Malaysia and Thailand.

President Susilo Bambang Yudhoyono, who was in Papua province visiting the victims of an earthquake there earlier this month, declared Sumatra a national disaster area.

Aceh has been hit by separatist violence for 26 years, and Jakarta has prevented foreign journalists and aid agencies from visiting the region for more than a year. It appeared likely that the restrictions on international aid workers would be lifted to allow emergency supplies to be sent to the province.

"We still don't know what's happening there because of a lack of communication," said Vice President Jusuf Kalla. "We're sending our two top ministers to Aceh right now. We're also preparing food supplies, medicines and makeshift shelters as emergency backup."

Thousands of people abandoned their homes and were headed for higher ground after the earthquake, centered 40 kilometers (25 miles) below the seabed, sent waves surging inland at about 8 a.m. (0100 GMT), officials said.

An AP reporter in the village of Lancuk close to Lhokseumawe saw several bodies wedged in trees amid a scene of destruction. Dozens of houses were washed away.

"Waves as high as two or three meters suddenly rose up in the sea," said a fisherman who identified himself as Marzuki.