A powerful earthquake toppled a 17-storey apartment building in southern Taiwan on Saturday, killing at least five people, including a 10-day-old girl, and triggering frantic efforts to rescue about 35 people feared trapped inside.

The baby and three of the other dead — a 55-year-old woman and a 50-year-old man — were from an apartment complex where the floors of a tower block pancaked down onto to each other when the 6.4 magnitude tremor hit at around 4 a.m. local time, at the start of a Lunar New Year holiday.

Rescuers mounted hydraulic ladders and a crane to scour the wreckage, plucking 221 survivors to safety so far, with dozens taken to hospital, a fire brigade official said.

Elsewhere in the city of 2 million people, several buildings tilted at alarming angles but a fire department official said rescue efforts were now focused entirely on the apartment block.

Taiwan's official news agency said 256 people were believed to have been living in 92 households.

The Taiwan city emergency response centre says 155 have been hospitalized. The news website ET Today is reporting the number has climbed to 318 people hospitalized.

"I was watching TV and after a sudden burst of shaking, I heard a boom. I opened my metal door and saw the building opposite fall down," said a 71-year-old neighbour who gave his name as Chang.

A plumber, he said he fetched some tools and a ladder and prised some window bars open to rescue a woman crying for help.

"She asked me to go back and rescue her husband, child, but I was afraid of a gas explosion so I didn't go in. At the time there were more people calling for help, but my ladder wasn't long enough so there was no way to save them."

The magnitude 6.4 quake was centred 43 kilometres southeast of Tainan, at a depth of 23 kilometres, the U.S. Geological Survey said. It struck just before 4 a.m. local time. 

The quake struck at a depth of 23 kilometres, revised from an initial estimate of 10 kilometres. Shallow quakes can be more devastating than deeper tremors.

One elderly woman, wrapped in blankets, was strapped to a board and slowly slid down a ramp to the ground as the cries of those still trapped rang out. Rescuers used dogs and acoustic equipment to pick up weaker signs of life among the rubble.

5 aftershocks

At least five aftershocks of 3.8-magnitude or more shook Tainan about half an hour after the initial quake, according to Taiwan's Central Weather Bureau.

Taiwan President Ma Ying-jeou, speaking to reporters in the capital before leaving for the disaster scene, said authorities were not clear on the extent of the damage.

"The disaster situation is not very clear yet. We will do our utmost to rescue and secure (survivors)," Ma said.

Several other buildings had also been damaged, including one that was pictured leaning at an alarming angle over a street in Tainan, a city of 2 million people, many of whom lived through a massive 1999 tremor that killed about 2,400 people.

QUAKE-TAIWAN/

The quake struck at around 4 a.m. local time Saturday morning. (Pichi Chuang/Reuters)

Power cut to thousands

Tainan mayor William Lai said it was too early to say if shoddy construction was responsible for the devastation at the apartment complex with the 17-storey tower which collapsed.

"We will chase the legal responsibility later," he told reporters.

China's Taiwan Affairs Office, which in is charge of Beijing's relations with the self-ruled island, said China was willing to provide help if needed, Chinese state news agency Xinhua said. Beijing regards Taiwan as a wayward province.

The quake initially cut power to 168,000 households in Tainan, many of whose residents lived through a massive 1999 tremor that killed about 2,400 people. Later, utility Taipower said power had been restored to all but about 900 households.

Taiwan Semiconductor Manufacturing Co (TSMC), the world's largest contract chipmaker, said some of its wafers made in Tainan had been damaged and some customers might be affected, though first-quarter shipments remained on track. TSMC will step up production to make up for any delayed shipments, spokeswoman Elizabeth Sun said. It is a big supplier to global smartphone firms, including Apple Inc. Other major Apple suppliers in Taiwan reported no impact on operations.

Taiwan's defence ministry said 810 soldiers had been mobilized for rescue efforts.

Authorities said cracks had been found in a dam but there was no immediate danger. Some bullet train services were suspended to the south as track inspections were carried out, Taiwan High Speed Rail Corp said in a statement.

Taiwan Earthquake

A Taipei-based TV station reported that 30 people were rescued from the seven-storey building after the 6.4-magnitude earthquake. (Associated Press)

Cries of trapped residents heard

Taiwan lies in the seismically active "Pacific Ring of Fire". Local TV quoted Tainan residents as saying the quake felt worse than the 1999 tremor, centred in central Taiwan.

Taiwan's Formosa TV said its reporters could hear the cries of some residents trapped inside the collapsed apartment tower as firefighters, police and troops swarmed the area.

Firefighters hosed down part of the building to prevent a fire while others used ladders and a crane to enter upper floors. The building appeared to have collapsed onto the first story where a child's clothes fluttered on a laundry line.

According to the USGS, the last time Taiwan was struck by a quake of the same magnitude as Saturday's was in April 2015, but that quake was deeper.

with files from The Associated Press