Tremors were felt across the island and high-rises in Taipei swayed.
The quake struck at 5.28am at a depth of 10km in north-eastern Yilan county, startling sleeping residents.
A 60-year-old woman was killed outside Taipei after a closet fell on her during the quake, the National Fire Agency said.
More than 10,000 houses around the greater Taipei area and neighbouring Yilan - a popular tourist area - lost power.
Rail authorities suspended some train services in Yilan, affecting thousands of passengers.
Taiwan was already on alert for typhoon Lekima, which is gaining momentum and is expected to buffet the island with powerful winds and heavy rains. The typhoon is forecast to edge towards mainland China on Friday.--AFP