A tsunami alert in Japan has been called off after a 6.9-magnitude earthquake off the south-eastern coast of Taiwan on Sunday, officials said.
The US Geological Survey said the quake hit at 2.44pm local time (11.44am UAE) about 50 kilometres north of the south-eastern city of Taitung at a depth of 10km. It was first recorded as 7.2 magnitude but later downgraded to 6.9.
Japan's Meteorological Agency issued a tsunami advisory to remote islands near Taiwan, but later cancelled the warning by early evening local time, saying high waves were not expected.
Taiwan is regularly hit by earthquakes as the island lies near the junction of two tectonic plates.
The mountainous island sits on the "Ring of Fire", an arc of intense seismic activity that stretches through South-East Asia and across the Pacific basin.
A 6.6-magnitude quake hit the same region on Saturday and there have been many tremors since, with Sunday's the strongest by far.
In the Taiwanese town of Yuli, a two-storey building that had a 7-Eleven convenience store on the ground floor collapsed.
Video footage posted by Taiwan's Central News Agency showed panicked residents running towards the building, which sent up a thick cloud of dust as it caved in.
The Hualien fire department said four people who were trapped in the building were rescued.
Two other buildings in the town collapsed but no one was inside them, the department added. Two nearby bridges collapsed while two others were damaged.
Taiwan Railways Administration said a train derailed in Dongli station in Hualien after it was hit by concrete from an overhead canopy that came loose during the quake.
Photographs shared on social media showed the train's six carriages leaning at an angle in the station.
The railways administration said the 20 on-board passengers were evacuated and no injuries were reported.
Shaking was also felt in the capital Taipei, with residents posting videos of chandeliers and paintings swaying on social media.
Taiwan's President Tsai Ing-wen urged people to be vigilant for further aftershocks in the coming hours.
"Water and electricity supplies in some areas are also affected by the earthquake," she wrote on Facebook. "The related disaster relief work is in full swing."
The China Earthquake Network Centre said tremors were felt in coastal areas including Fujian, Guangdong, Jiangsu and Shanghai.
Most of Taiwan's population lives on the flat western coast and in Taipei.
The scenic eastern coast is more remote and less populated but a major tourist draw.
It is regularly hit by quakes and most cause minimal damage but the island also has a long history of deadly tremors.
Hualien, a tourist hotspot, was struck by a 6.4-magnitude earthquake in 2018 that killed 17 people and injured nearly 300.
In September 1999, a 7.6-magnitude quake killed about 2,400 people in the deadliest natural disaster in the island's history.