Buildings shook briefly in Taipei on Monday as a 6.1 magnitude earthquake struck off Taiwan's eastern coast.
There were no immediate reports of damage.
The earthquake had a depth of 27.5 kilometres with its epicentre off Taiwan's east coast, roughly halfway between the coast of Hualien county and the southern Japanese island of Yonaguni, the weather bureau said.
The earthquake could be felt across Taiwan, it said.
It also shook parts of south-western Japan, the Japan Meteorological Agency said. The agency said there may be small swelling of the water, but that there was no danger of a tsunami.
Taiwan lies near the junction of two tectonic plates and is prone to earthquakes.
More than 100 people died when a quake hit southern Taiwan in 2016, while a 7.3 magnitude earthquake killed more than 2,000 people in 1999.