Rescuers are continuing their efforts to save people trapped under rubble and find those unaccounted for after a 6.4-magnitude earthquake hit Taiwan.

At least four people have died and hundreds more are injured following the earthquake on Tuesday night, while more than 140 people are said to be missing.

The tremor caused at least four buildings in worst-hit Hualien county to cave in and tilt dangerously.

Video footage and photos showed several buildings leaning at sharp angles, their lowest floors crushed into mangled heaps of concrete, shattered glass, bent iron beams and other debris.

Firefighters could be seen climbing ladders hoisted against windows as they sought to reach residents inside apartments.

The earthquake injured 225 people, two dozen of them critically, in Hualien county, Taiwan’s Central News Agency reported.

Taiwan Earthquake
Rescuers are seen entering an building that collapsed onto its side (Hualien County Fire Bureau via AP)

The force of the tremor buckled roads and disrupted electricity and water supplies to thousands of households, the National Fire Agency said.

Taiwanese President Tsai Ing-wen moved to reassure the Taiwanese public that every effort would be made to look for survivors.

In a post on her official Facebook page, Tsai said she had arrived in Hualien on Wednesday to review rescue efforts.

Tsai said she “ordered search and rescue workers not to give up on any opportunity to save people, while keeping their own safety in mind”.

“This is when the Taiwanese people show their calm, resilience and love,” she wrote. “The government will work with everyone to guard their homeland.”

The official news agency said all but two of the 145 people who could not be reached might be in the Yunmen Cuiti building, a 12-story apartment building, though it said it did not immediately have an estimate of how many were trapped.

Taiwan Earthquake
Many buildings were left leaning after the earthquake (Hualien County Fire Bureau via AP)

Chen Tzai-Tung, a worker with the government disaster centre, said it was not safe for rescuers to enter the Yunmen building because it was still leaning further bit by bit.

“It’s still in the process of tilting, so it would be dangerous to go in there,” he said. “They’re scrambling for time.”

A hotel employee died when the ground floor caved in at the Marshal Hotel, and another person died in a residential building, the agency reported.

A maintenance worker who was rescued after being trapped in the hotel’s basement said the force of the earthquake was unusual.

“At first it wasn’t that big … we get this sort of thing all the time and it’s really nothing. But then it got really terrifying,” Chen Ming-hui said after he was reunited with his son and grandson. “It was really scary.”

Taiwan Earthquake
Emergency services attend the scene (EBC via AP)

Other buildings shifted on their foundations and rescuers used ladders, ropes and cranes to get residents to safety.

Taiwanese media reported that a separate hotel known as the Beautiful Life Hotel was also tilting. Taiwan’s Central News Agency posted photos showing a road fractured in several parts.

Bridges and some highways were closed pending inspections.

With aftershocks continuing through the night, residents were being directed to shelters, including a newly built baseball stadium, where beds and hot food were provided.