PANGANDARAN , Indonesia, Wednesday, July 19 — Thousands of terrified residents in this coastal community huddled together in makeshift camps, parents clutching small children, on the crest of nearby hills Tuesday night, fearing a repeat of Monday’s tsunami that has now killed more than 300 people and injured hundreds more.

Most villagers said they were taken by surprise when the six-foot wall of water pounded the shore, leveling seaside houses and hotels up to 500 meters inland. Wood and debris blocked roads, while cars and small boats, carried inland by the waves, littered the many coconut groves dotting the shore.

A 7.7 magnitude undersea earthquake at about 3 p.m. Monday set off the tsunami, but most residents said they barely felt the quake and only realized the danger after the ocean began to quickly recede — a sign of a coming tsunami.

“The tremors were not strong, so I felt no need to worry,” said Mumu, 42, whose 15 tourist cottages were reduced to hollow frames. “But then I heard the screams of the people on the beach and when I looked over the fence the water was rushing toward me.”