Five more buildings including a hospital have also been damaged with roads strewn with rubble, cracks along highways and damaged buildings tilted at angles.
Images on local television showed the Marshal Hotel in Hualien slanted on its side, partially crumpled into the ground.
Hualien is a popular tourist destination on Taiwan's eastern coast and home to about 100,000 people.
Rescure workers search the damaged Marshal Hotel in Hualien, eastern Taiwan, early February 7, 2018, after a strong quake struck the island. The epicentre of the quake was believed to be in Hualien County, according to reports.
According to local media, around 30 people are stuck inside the hotel.
Among the buildings toppled in the quake was the Marshal Hotel in Hualien, where three people were trapped inside, the government said. Most are minor and cause little or no damage. "I wouldn't be surprised for there to be a number of aftershocks in the next couple of days".
In addition, two bridges in the area were damaged and have been closed, Lin said.
The US Geological Survey said the quake struck late last night about 21km northeast of Hualien, on the island's east coast.
A magnitude-6.4 natural disaster has rocked Taiwan's east coast, following a "swarm" of 19 earthquakes over the past 48 hours.
Other buildings shifted on their foundations and rescuers used ladders, ropes and cranes to get residents to safety.
A damaged building is seen after an natural disaster hit Hualien, Taiwan February 7, 2018.
A magnitude-7.6 quake in central Taiwan killed more than 2,300 people in 1999.