A 6.4-magnitude quake on the east coast of Taiwan has left two dead and 219 injured, the government said, after buildings crumbled and trapped people inside.
About 150 people are missing, according to the government, with many believed to be still trapped inside buildings.
A hotel and a residential block were the worst hit by the quake in the port city of Hualien, said the national fire agency.
Five more buildings including a hospital had also been damaged, the agency added, with televison footage showing roads strewn with rubble, cracks along highways and damaged buildings tilted at angles.
Hualien, an area popular with tourists, is home to about 100,000 people. Its streets were buckled by the force of the quake, with around 40,000 homes left without water and more than 600 without power.
The worst-hit Marshal Hotel partly crumpled into the ground, leaving it slanting on its side, as rescuers on cranes attempted to free people from its upper floors.
The government said two bridges in the city were either cracked or could not be used due to the quake.
"It's the biggest quake I've experienced in Hualien in more than 10 years," resident Blue Hsu told reporters, who said his home shook violently.
Describing the scene at the Marshal Hotel, Hsu said the bottom storeys had been crushed.
"The lower floors sunk into the ground and I saw panicked tourists being rescued from the hotel. There is one bulldozer and about 50 rescuers on the scene," he said.
Hualien is one of Taiwan's most popular tourist hubs as it lies on the picturesque east coast rail line and is near to popular Taroko Gorge.
Facebook user Sun Chen-hsiang, who was livestreaming the scene at the hotel from a distance, told how the building next to his home had collapsed.
"All the people watching this livestream, please get yourself to a safe place and don't stay home," he said.
Another resident told reporters how an apartment block near his flat had also partially collapsed.
"I saw the first floor sink into the ground. Then it sunk and tilted further and the fourth floor became the first floor," said Lu Chih-son, 35, adding he saw 20 people rescued from the building.
"My family were unhurt, but a neighbour was injured in the head and is bleeding. We dare not go back home now. There are many aftershocks and we are worried the house is damaged."
There had been at least 15 aftershocks following the quake, Taiwan's weather bureau said.
Officials from Hualien fire department said 149 people had been rescued from damaged buildings.
Fire officials said up to 16 people remained trapped in a residential building.
Rescuers from around the island were preparing to help, Taiwan's president Tsai Ing-wen said on her Facebook page, promising rapid disaster relief.
Tsai went to the scene of the quake early on Wednesday to help direct rescue operations.
"The president has asked the cabinet and related ministries to immediately launch the 'disaster mechanism' and to work at the fastest rate on disaster relief work," Tsai's office said in a statement.
The quake hit at 23.50pm around 21km northeast of Hualien, according to the United States Geological Survey.
Taiwan Semiconductor Manufacturing Co, the world's largest contract chipmaker and major Apple supplier, said initial assessments indicated no impact from the earthquake.
It follows almost 100 smaller tremors to have hit the area in the last three days and comes exactly two years since a quake of the same magnitude struck the southern Taiwanese city of Tainan, killing more than 100 people.
Most of the death toll from the February 2016 earthquake was from the 16-storey Wei-kuan apartment complex, which toppled on its side with many of its residents buried in the rubble.
It was the only high-rise in Tainan to crumble completely in the quake, which came two days before Lunar New Year, when many people would have been visiting relatives for the biggest celebration of the Chinese calendar.
The safety of the building was called into question immediately after the disaster, when metal cans and foam were found to have been used as fillers in the concrete and residents said there had been cracks in the structure.
Five people were charged over the disaster, including the developer and two architects, with prosecutors saying they "cut corners" that affected the building's structural integrity.
Taiwan lies near the junction of two tectonic plates and is regularly hit by earthquakes.
The island's worst tremor in recent decades was a 7.6 magnitude quake in September 1999 that killed around 2,400 people.