Taipei, Taiwan (CNN) The death toll from a TransAsia Airways plane crash in Taiwan rose to 40 on Saturday, authorities said, as details emerged that both engines lost power.

Flight 235 crashed into a river in Taiwan's capital, Taipei, shortly after takeoff Wednesday with 58 people on board.

Three others remain unaccounted for, while 15 people survived, authorities said.

As crews search for the missing, more revelations emerged on what led to the tragedy.

Pilots grappled with engine problems before the plane clipped a bridge and plunged into a river, Taiwan's aviation safety agency said.

During the crisis in the cockpit, the pilots received a series of alerts, starting with an alarm related to one of the engines and followed by five stall warnings as the plane lost thrust.

Engine trouble

The two engines on the ATR 72 turboprop aircraft stopped producing power one after the other, leaving the plane flying without thrust for more than a minute, according to the agency.

The alarms sounded for the first engine that ceased power output, but the crew was then heard discussing switching off the other engine, before it also stopped generating power. Investigators are looking into the crew's actions and are trying to understand why the second engine was shut off.

JUST WATCHED TransAsia pilot's family in mourning Replay More Videos ... MUST WATCH TransAsia pilot's family in mourning 02:05

Data show that the pilots should have received a visual warning detailing which of the two engines had a problem, said Thomas Wang, managing director of the Aviation Safety Council.

"There would be a message: 'number two engine flameout' to the pilot, and of course the corresponding checklist for that," Wang said.

He would not comment further on whether the crew followed proper procedures in responding to that warning.

"At this moment we just release the numbers, the parameter we've confirmed, we did not release any judgment who did what at this time," he said.

Seconds later, pilots issued a mayday alert to air traffic control, announcing an engine flameout. They eventually managed to restart one of the engines that had been shut down, but it was too late to prevent a crash.

Aviation Safety Council officials said Saturday that the top priorities are finishing up the transcript of the cockpit voice recorder, and examining the wreckage, specifically the engines and the cockpit.

They are also gathering information to try to understand why the first engine auto feathered after take off, which meant it was no longer producing thrust. Normally, the blades of a propeller will auto feather, or rotate, when an engine fails, in order to reduce drag, and enable the plane to be safely flown on a single engine, Wang explained.

Final analysis of Flight GE235's flight data recorder and cockpit voice recorder is months away, investigators said.

JUST WATCHED TransAsia pilot may have shut down wrong engine Replay More Videos ... MUST WATCH TransAsia pilot may have shut down wrong engine 02:36

Survivors describe horror

The reported engine problems dovetail with the account of Huang Chin-shun, a 72-year-old survivor of the crash.

"I thought something's wrong with the engine because I always take this flight," Huang told CNN affiliate ETTV from his hospital bed Thursday.

Taipei Fire Department Lt. You Chia-yu said that some passengers were still inside the plane, banging on windows, when first responders arrived.

These firefighters pried open one of the aircraft's doors, with some of them taking off gear to fit through a "really tight" space and get inside.

"The visibility in the water was really low, so we knew we had to just get in there first. It was really chaotic," You said. "... We believe we got them all out in time."

Stephen Fredrick, a pilot who once flew ATRs for American Airlines, told CNN this week that it looked like Flight GE235 was gliding when dashboard cameras on the ground captured the moments before it crashed into the river.

Fredrick pointed to the position of the nose -- slightly down -- and the wings, which were level. He said he also thought the plane may have lost power in one or both of the engines.

TransAsia was involved in another deadly disaster in July. Forty-eight people died after an ATR 72 aircraft operated by the airline crashed as it was attempting to land in the Taiwanese Penghu Islands during bad weather.