The quake caused the skyscrapers in the capital Taipei to sway, and tremors could be felt throughout the island. The railway authority has canceled parts of the train traffic, which has affected thousands of passengers.

At the same time, the island nation is preparing for typhoon Lekima, which is expected to move inland during Thursday, with the risk of landslides and flooding.