The Central Weather Bureau says the quake Thursday registered at magnitude 5.6.
The tremor struck about 23 miles (37 kilometers) north of Hualien city and it swayed buildings in the capital, Taipei. Hualien is about 110 miles (180 kilometers) southeast of Taipei.
Earthquakes frequently rattle Taiwan, but most are minor and cause little or no damage.
However, a magnitude-7.6 earthquake in central Taiwan in 1999 killed more than 2,300 people.