The US Geological Survey measured the quake at magnitude 6.0 and said it struck at 10:03 a.m. (0203 GMT), 48 kilometers (30 miles) east of Nantou county in central Taiwan at a depth of 20.7 kilometers.
Taiwan’s central weather bureau put the magnitude at 6.1 and said it was felt across the island.
The national fire agency said at least 20 people were slightly injured in Nantou and nearby Changhua and Taichung counties during the quake, which also triggered a fire in Nantou that had since been extinguished.
The agency said it had received five reports of people trapped in lifts during the quake but they had all found their way to safety.
Cable news channel SET TV showed footage of one woman in Nantou being carried to an ambulance after she was hit in the head by fragments of a ceiling that came loose during the quake.
Taiwan’s high speed rail company said it had suspended all trains pending safety checks while the metro system in the capital Taipei was also temporarily suspended.
Many buildings in Taipei swayed while television footage showed some school children in Nantou fleeing their classrooms during the quake.
Nantou county was the epicenter of a 7.6-magnitude quake in September 1999 that killed around 2,400 people in the deadliest natural disaster in the island’s recent history.
Taiwan lies near the junction of two tectonic plates and is regularly hit by earthquakes.