The pilot of an airplane that took off from Miami and was bound for South America died on Monday after he collapsed following takeoff. According to the U.K.’s Independent, Captain Ivan Andaur began feeling unwell several hours into a flight from South Florida that was scheduled to land in Santiago, Chile. While in the bathroom of the airplane on a Chilean LATAM Airlines flight, Andaur reportedly collapsed. Andaur’s relief captain and first officer diverted the Boeing 787-9 Dreamliner to Panama City while attempts were made to resuscitate him. But the pilot was dead by the time the plane touched down at Tocumen International Airport. LATAM Airlines said in a statement that Andaur had flown for the company for 25 years. “LATAM Airlines Group reports that flight LA505 yesterday, which was on the Miami-Santiago route, had to land at the Tocumen International Airport in Panama due to a medical emergency for one of the three members of the command crew. When the plane landed, emergency services provided life-saving help, but the pilot sadly passed away,” the airline said in a statement. “We are deeply moved by what has happened, and we extend our sincere condolences to the family of our employee,” the company also said. “We are deeply grateful for his 25-year career and his valuable contribution, which was always distinguished by his dedication, professionalism, and dedication.” The company also said that its 271 passengers were never in any danger. “During the flight, all the necessary safety protocols were carried out to safeguard the life of the affected pilot,” LATM said. According to the Independent, after Andaur’s death, the flight departed Panama and arrived safely in Santiago. NBC’s “Today” show reported passengers applauded the flight’s remaining staffers both when the plane landed and also later in the airport. LATAM Airlines calls itself the “leading airline in Latin America” and serves more than 140 cities. Two days after the death of Andaur while en route to Chile, a Southwest Airlines flight that had just departed Houston’s William P. Hobby Airport experienced an engine fire. A clip of the fire was recorded by one of the airplane’s passengers. KHOU-TV reported the flight was headed to Cancun and landed safely back in Houston. This article appeared originally on The Western Journal.