Japanese forecasters had warned the 6.6 magnitude earthquake could cause a tsunami as high as one metre (three feet) affecting several islands in the Okinawa chain, but lifted the alert around an hour later, with no abnormal waves recorded.
No damage was reported in Japan, but a four-storey apartment building in New Taipei City caught fire after an electrical box outside the block exploded in the quake.
Another 18-year-old resident remains in hospital with smoke inhalation, but he is not in a serious condition, the fire service said.
Residents and office workers were evacuated from a building in central Taipei because of a feared gas leak and vehicles in a nearby multi-storey carpark were overturned, but no one was injured.
In Japan, local authorities urged people to move away from the coast and seek higher ground, in a drill that has become fairly regular in a country prone to powerful earthquakes and occasional devastating tsunamis.
Boats were seen sailing out to sea -- common practice when a tsunami warning is issued because away from the coast a tsunami is little different from a swell.
However, an hour after the quake, the Japan Meteorological Agency cancelled the warning.
The US Geological Survey said the 6.6 magnitude quake, which Japanese authorities had originally put at 6.8, struck 71 kilometres east of Hualien, Taiwan at 0143 GMT.
Japan sits at the confluence of four of the earth's tectonic plates and records more than 20 percent of the planet's most powerful earthquakes every year.
Strict building codes and a long familiarity with the dangers mean quakes that might cause devastation in other parts of the world are frequently uneventful in Japan.
However, some disasters have proven exceptionally deadly, and more than 18,000 people were killed by a huge tsunami that smashed into the northeast coast in 2011 after a huge 9.0 magnitude earthquake.
