Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

TAIPEI, Taiwan — Taipei's mayor hailed the pilot of a crashed TransAsia Airways plane a hero on Thursday for narrowly avoiding buildings and ditching the stalled aircraft in a river, likely averting a worse disaster.

At least 31 people were killed when Flight GE235 lurched between buildings, clipped a taxi and an overpass with one of its wings and crashed upside down into shallow water shortly after take-off on Wednesday. There were 15 known survivors and 12 more unaccounted for.

"He really tried everything he could," Taipei Mayor Ko Wen-je said of the pilot, his voice breaking with sobs.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Amateur video recorded by a car dashboard camera showed the plane nose-up as it barely cleared the buildings close to Taipei's Songshan airport before crashing into the river.

"The pilot's immediate reaction saved many people," said Chris Lin, brother of one of the survivors.

Aerospace analysts said it was too early to say whether the pilots intentionally pulled the plane above the buildings, and noted that the crew may have been aiming for the river to reduce casualties.

A more conclusive picture will emerge only when authorities release details from the plane's cockpit voice and flight data recorders, which were recovered on Wednesday.

The pilot and co-pilot of the almost-new turboprop ATR 72-600 were among those killed, Taiwan's aviation regulator said. TransAsia identified the pilot as 42-year-old Liao Chien-tsung.

Taiwanese media reported that it appeared Liao had fought desperately to steer his stricken aircraft between apartment blocks and commercial buildings.

IN-DEPTH

- Reuters