TAINAN, Taiwan (AP) — Rescuers were searching late Saturday for more than 100 people still missing after a powerful, shallow earthquake struck southern Taiwan before dawn and caused a high-rise residential building to collapse, killing at least 13 people and injuring hundreds.

Nearly 340 people were rescued from the rubble in Tainan, the city hit worst by the quake. About 2,000 firefighters and soldiers scrambled with ladders, cranes and other equipment to the ruins of the 17-floor residential building, which folded like an accordion onto its side after the quake struck.

TAINAN, TAIWAN - FEBRUARY 06:  Rescue personnel search for survivors at the site of a collapsed building in the southern Taiwanese on February 6, 2016 in TAINAN, Taiwan. A magnitude 6.4 earthquake hit southern Taiwan early Saturday, toppling several buildings and killing at least two people in Tainan, according to local news reports.  (Photo by Ashley Pon/Getty Images)

Rescue personnel search for survivors at the site of a collapsed building in the southern Taiwanese on February 6, 2016 in TAINAN, Taiwan. (Photo by Ashley Pon/Getty Images)

Local authorities said Saturday night that more than 100 people remained missing and that rescuers were racing to find them. Taiwan’s official Central News Agency reported that 172 people were missing.

The quake came two days before the start of Lunar New Year celebrations that mark the most important family holiday in the Chinese calendar. The building had 256 registered residents, but far more people could have been inside when it fell because the population might have swelled ahead of the holiday, when families typically host guests.

Local media said the building included a care center for newborns and mothers, and a newborn was among the dead in the disaster.

Most people were caught asleep when the magnitude-6.4 earthquake occurred at about 4 a.m., 22 miles (35 kilometers) southeast of Yujing. It struck only 6 miles (10 kilometers) underground, according to the U.S. Geological Survey.

The high-rise building “first starting shaking horizontally, then up and down, then a big shake right to left,” said Tainan resident Lin Bao-gui, a secondhand car salesman whose cars were smashed when the building collapsed across the street from him.

Rescue personnel work at the site of a collapsed building in the southern Taiwanese city of Tainan on February 6, 2016 following a strong 6.4-magnitude earthquake. A powerful earthquake in Taiwan felled a 16-storey apartment complex full of families who had gathered for Lunar New Year celebrations in the early hours of February 6, with at least seven dead and more than 30 feared trapped. AFP PHOTO / Sam Yeh / AFP / SAM YEH        (Photo credit should read SAM YEH/AFP/Getty Images)

Rescue personnel work at the site of a collapsed building in the southern Taiwanese city of Tainan on February 6, 2016 following a strong 6.4-magnitude earthquake. A powerful earthquake in Taiwan felled a 16-storey apartment complex full of families who had gathered for Lunar New Year celebrations. (Sam Yeh/AFP/Getty Images)

“I stayed in my bed but jumped up when I heard the big bang that was the sound of the building falling,” he said.

Authorities in Tainan said 13 people were killed, including 11 who were found at the ruins of the fallen building. The national Emergency Management Information center said 477 people were injured, with 380 of them discharged from hospitals by Saturday evening.

Rescuers found the bodies of a 10-day-old infant, three other children and six adults at the collapsed building, the information center said. One other death was reported at the site, but details were not immediately available.

Authorities said two people were killed by falling objects elsewhere in Tainan.

Rescuers pulled out at least 248 survivors from the collapsed building, the emergency management information center said.

Throughout Tainan, 337 people were rescued, the city government said.

The Taiwanese news website ET Today reported that a mother and daughter were among the survivors from the building, and that the girl drank her urine while waiting to be rescued, which happened sooner than expected.

Rescuers went apartment to apartment, drawing red circles near windows of apartments they already had searched.

“I went to the top floors of the middle part of the building, where we found five people, one of whom was in bed and already dead,” said Liu Wen-bin, a 50-year-old rescuer from Taichung. “Some people were found in the shower, some in the bedroom.”

Elsewhere in Tainan, dozens of other people were rescued or safely evacuated from damaged structures or buildings declared unsafe following the quake, including a market and a seven-floor building, authorities said. A bank building also careened, but no one was injured or trapped.

All told, nine buildings collapsed and five careened in Tainan, the emergency management information center said.

As dawn broke, Taiwanese TV showed survivors being brought gingerly from the high-rise, including an elderly woman in a neck brace and others wrapped in blankets. The trappings of daily life — a partially crushed air conditioner, pieces of a metal balcony, windows — lay twisted in rubble.

Rescue personnel work at the site of a collapsed building in the southern Taiwanese city of Tainan on February 6, 2016 following a strong 6.4-magnitude earthquake. A powerful earthquake in Taiwan felled a 16-storey apartment complex full of families who had gathered for Lunar New Year celebrations on February 6, with at least eleven dead and more than 30 feared trapped. AFP PHOTO / Sam Yeh / AFP / SAM YEH        (Photo credit should read SAM YEH/AFP/Getty Images)

Rescue personnel work at the site of a collapsed building in the southern Taiwanese city of Tainan on February 6, 2016 following a strong 6.4-magnitude earthquake.  (Sam Yeh/AFP/Getty Images)

People with their arms around firefighters were being helped from the building, and cranes were being used to search darkened parts of the structure for survivors.

Men in camouflage, apparently military personnel, marched into one area of collapse carrying large shovels.

The emergency management information center said 1,236 rescuers from outside Tainan were deployed, including 840 from the army, along with six helicopters and 23 rescue dogs.

Tainan’s municipal government said it mobilized nearly 600 professional and volunteer firefighters.

The quake was felt as a lengthy, rolling shake in the capital, Taipei, on the other side of the island. But Taipei was quiet, with no sense of emergency or obvious damage just before dawn.

Residents in mainland China also reported that the tremor was felt there. The Beijing government offered to help as needed.

Because of the spectacular fall of the residential high-rise, questions surfaced about whether the 1989 structure had shoddy construction. Tainan’s government said the Wei Guan building was not listed as a dangerous structure before the quake, and Taiwan’s interior minister, Chen Wei-zen, said an investigation would examine whether the developer had cut corners during construction.

Earthquakes frequently rattle Taiwan, but most are minor and cause little or no damage. However, a magnitude-7.6 quake in central Taiwan in 1999 killed more than 2,300 people.