A 7.0 magnitude earthquake struck some 32 km (20 miles) off Taiwan's northeastern coastal city of Yilan late on Saturday, the island's weather administration said.
The quake shook buildings in the capital Taipei and had a depth of 73 km (45 miles), it added.
Damage assessment was underway, the National Fire Agency said.
Taiwan lies near the junction of two tectonic plates and is prone to earthquakes.
More than 100 people were killed in a quake in southern Taiwan in 2016, while a 7.3 magnitude quake killed more than 2,000 people in 1999.