TAIPIE: Taiwan rescuers scoured a river for 12 people still missing from a TransAsia plane crash Thursday, as the pilot, who died in the crash, was hailed a hero for apparently battling to avoid hitting built-up areas.

Hundreds of rescuers in boats, as well as divers and soldiers mounted the search in the chilly waters, as the death toll rose to 31 with more bodies located including those of the pilot and co-pilot, authorities said.

The TransAsia ATR 72-600 crashed shortly after take-off from Songshan airport in Taipei Wednesday, hitting an elevated road as it banked sidelong toward the Keelung River, leaving a trail of debris including a smashed taxi.

In an operation overnight large parts of the plane’s fuselage were lifted from the river, enabling rescuers to recover bodies trapped inside, while divers Thursday battled strong currents to search downstream for more victims.

Pilot Liao Chien-tsung was applauded by aviation experts for apparently steering the turboprop plane, which had 53 passengers and five crew on board, away from populated areas, potentially avoiding more deaths and damage.

“The pilot apparently made a conscious effort to avoid further and unnecessary casualties by ditching in the river. It was a very courageous move,” Hong Kong-based aviation analyst Daniel Tsang told AFP.

Emotional citizens posted their praise and condolences on social media sites.

“I believe the pilot managed to steer the plane away from high-rise buildings, he is a hero,” Gin Oy, a writer and actress, said on her Facebook page.

The Apple Daily newspaper ran a front-page story thanking “the pilot for saving Taipei.”

“We are proud of him. He was very brave to avoid the buildings,” Liao’s aunt told reporters at a funeral home in Taipei.

Friends and relatives described the 41-year-old Liao as a diligent and family-loving man from a humble background who studied hard to join the air force before becoming a commercial pilot.

President Ma Ying-jeou paid his respects to the victims and comforted their families at a funeral home in Taipei and visited the wounded at several hospitals.

Near the river, dozens of weeping relatives called out the names of their loved who perished as monks chanted scripts and waved the victims’ clothes in front the plane’s wreckage in a religious ritual to guide the spirits home.

Condolences from abroad poured in.

Pope Francis sent a message to Taiwan’s archbishop Hung Shan-chuan offering prayers for the dead and “strength and comfort” for the injured and mourning.

The United States’ de facto embassy in Taiwan also offered its condolences.

An investigation into the cause of the crash is underway, with aviation experts from France and Canada expected to arrive in Taiwan this week, Taiwanese authorities said.

Tales of miracle escapes have emerged. Television footage showed a father cuddling his toddler son as they were taken to shore by boat after being rescued Wednesday.

Together with the child’s mother, the family had switched seats on the plane “out of a hunch” that saved their lives, the United Daily News said, quoting a family friend.

Their new seats put them next to a crack in the plane after it crashed and Lin was able to pull his wife to safety and then revive his son after spotting him in the water, blue and unresponsive.