PANAMA CITY, Panama — An airline pilot who started having medical issues during a flight from Miami to Santiago, Chile, died shortly after the plane was forced to make an emergency landing in Panama, reports say.

LATAM Airlines released a statement to USA Today confirming the pilot died after Flight LA-505, a Boeing 787-9, landed Monday in Panama City. The pilot’s identity was not released but the statement said he had worked for the airline for 25 years.

The pilot was a member of a three-man crew, NBC News reports. According to the Aviation Herald, the pilot went to the restroom during the flight but did not return to the cockpit.

The Herald reports members of the plane’s crew tried to resuscitate him until the plane landed in Panama.

“All the necessary protocols were followed during the flight to safeguard the life of the affected pilot. Unfortunately, after landing and receiving further medical assistance, the pilot passed away,” the airline said in a statement to Fox Business.