Hualien, Taiwan (CNN) Aftershocks rocked Taiwan's eastern coast on Thursday as rescue workers searched a teetering multi-story building for missing residents feared trapped inside more than 36 hours after a deadly earthquake.

At least nine people were killed and 270 injured when the magnitude 6.4 quake struck late Tuesday 22 kilometers (13 miles) north of the city of Hualien, authorities said. It also damaged bridges and buckled roads in and around Hualien, a city on the island's northeastern shores.

A magnitude 5.7 earthquake shook the already devastated tourist town in the early hours of Thursday, Taiwan's official news agency CNA said, the largest in a series of aftershocks.

Eight people were still unaccounted for in Hualien on Thursday afternoon, all of whom were believed to have been living or temporarily staying at the now badly damaged and tilting Yun Men Tsui Ti building, officials said.

Rescuers rest near the site of damaged buildings in Hualien on February 8.

Emergency workers used enormous beams, raised with a crane, to prop up the building -- a large residential and commercial complex -- which leaned ominously over the street below.

Rescuers were digging "nonstop on the backside of the building" to try to find people feared trapped on the lower floors, Hualien County fire commander Zhu Zhe-min said. No one is any longer believed trapped above the second floor, he said.

The missing people were all connected to the Yun Men Tsui Ti building, officials said. Seven had been staying at a bed-and-breakfast called the Beauty Inn inside the building.

Emergency workers block off a street in Hualien, Taiwan, where a building threatens to collapse.

Melinda Yu, a resident of the fifth floor on the now-listing side, said she was marking her 50th birthday in her apartment when the quake struck. The floors below her seemed to collapse, and when the dust had cleared, she said, she looked out a broken window and found she essentially was on the ground floor.

"Someone was waiting for me outside, (saying), 'Give me your hand,' and pulled me out," she said.

One of her neighbors is missing, she said early Thursday.

Residents take shelter in a local stadium after an earthquake and aftershocks on February 7.

Worker found alive in collapsed hotel

The Yun Men Tsui Ti is one of four buildings in the city that were either tilting or had collapsed, authorities said.

At the flattened Marshal Hotel in downtown Hualien, rescuers reached two workers who had been trapped near the main counter in the lobby, Taiwan's official news agency, CNA, reported Wednesday.

One appeared dazed as rescue workers escorted him out. The other didn't survive.

A car sits crushed under a building Wednesday after a 6.4 magnitude quake hit in Hualien.

Meanwhile, 600 military personnel and more than 750 firefighters combed through rubble and helped with rescue efforts, according to Taiwan's Central Emergency Operation Center.

One of the dead was a Chinese tourist who was visiting with her son, according to CNA. She passed away Wednesday evening after suffering a head injury during the quake, the news agency reported.

Nine Japanese were injured and taken to the hospital, authorities said, but they have all been released. In total, 31 foreigners were affected, including 14 South Koreans, two Czechs, two Singaporeans and one Filipino, CNA reported.

Hualien is close to Taiwan's famous Taroko Gorge, a popular tourist destination.

Photos on state media showed the narrow highway in and out of the gorge on Wednesday morning covered in rocks, rubble and other debris from the earthquake.

Hundreds of military personnel are in Hualien to assist with the rescue effort.

Hundreds of Hualien residents whose homes were destroyed took shelter at a local stadium, with relief organizations providing emergency supplies.

Some 1,900 households lost power in the wake of Tuesday's quake, but most had it restored by Wednesday morning, according to the Central Emergency Operation Center.

However, an estimated 35,000 residents were still without water, the center said.

Pacific Ring of Fire

The quake struck late Tuesday in the East China Sea, north of Hualien, an eastern county that's home to more than 350,000 people.

The temblor was felt as far away as the capital, Taipei, about 120 kilometers (74 miles) to the north, according to reports sent to the US Geological Survey.

Taiwanese President Tsai Ing-wen, center, is briefed at the site of a collapsed building Wednesday.

Taiwanese President Tsai Ing-wen visited the scene of the earthquake Wednesday. Tsai thanked the island's first responders in a message on her official Twitter account.

Taiwan is situated on the Pacific Ring of Fire , which runs around the edge of the Pacific Ocean and is known for causing massive seismic and volcanic activity from Indonesia to Chile.

The Yun Men Tsui Ti building in Hualien leans over Wednesday after the earthquake.

'We're going to sleep in the tent'

Jason Grenier, a Canadian living with his Taiwanese wife and daughter just south of Hualien, said Wednesday that their home is intact and they have power and water. But the family was poised to spend a second straight night sleeping outside, wary of possible aftershocks.

Photos: Magnitude 6.4 earthquake rocks Taiwan Rescue services search for people at a damaged building in Hualien, Taiwan, on Wednesday, February 7. A 6.4 magnitude earthquake was recorded about 21 kilometers (13 miles) north of Hualien late Tuesday. Several people were killed and many were injured. Hide Caption 1 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan An emergency worker walks near a crane that was working to support the Yun Tsui building in Hualien. The residential building was shifted off its foundation during the quake. Hide Caption 2 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Rescue workers climb over debris at the Yun Tsui building. Hide Caption 3 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Emergency personnel rescue a pet dog from a damaged building in Hualien on February 7. Hide Caption 4 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Search-and-rescue teams look for survivors in Hualien. Hide Caption 5 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Emergency workers recover a victim from a destroyed building in Hualien on February 7. Hide Caption 6 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Clothes hang on the balcony of a leaning apartment building. Hide Caption 7 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan A crew searches for survivors believed to be trapped inside the collapsed Marshal Hotel in Hualien. Hide Caption 8 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan The Yun Tsui building leans perilously in Hualien. Hide Caption 9 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Rescuers search for survivors on February 7. Hide Caption 10 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan The Yun Tsui building is propped up after the quake. Hide Caption 11 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan In this handout photo released by the Taiwan presidential office, President Tsai Ing-wen, center back-facing, is surrounded by media as she is briefed in Hualien on February 7. Hide Caption 12 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Members of the fire services hose down damage. Hide Caption 13 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan An overview of the Yun Tsui building after the quake. Hide Caption 14 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan A car is crushed by a building that shifted off its foundation. Hide Caption 15 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Rescue workers check the area affected by the quake in Hualien. Hide Caption 16 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan A rescuer scales a damaged building in search of survivors. Hide Caption 17 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Guests of the quake-damaged Marshal Hotel take refuge outside on February 7. Hide Caption 18 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Members of the emergency services search for people in the debris of a collapsed building. Hide Caption 19 of 20 Photos: Magnitude 6.4 earthquake rocks Taiwan Emergency responders carry out search-and-rescue operations amid rubble outside the Marshal Hotel. Hide Caption 20 of 20

Tuesday night's quake was the most violent he's felt in his 17 years on the island, he said. It jolted his family awake and sent him scrambling for his 7-year-old daughter and running outside.

"Sometimes (earthquakes) kind of slam you up and down -- it's like the whole house jumps. Sometimes it's like a rocking. This was like a combination of everything all at once ... you could hear the earth groaning," Grenier, an instructor at National Dong Hwa University, said Wednesday.

The Greniers spent the rest of the night in a vehicle. On Wednesday, they pitched a tent on their property.

"Even tonight, we're going to sleep in the tent, I think," Grenier said. "Because every time there is a temblor, you have to get up and decide if you're going to bolt. It doesn't make for a restful sleep."