A United Airlines flight from Houston to Seattle on Thursday turned tragic when one of the pilots suffered a fatal heart attack mid-air.

The captain, whose name has not been released, was still alive when the plane carrying 161 passengers made an emergency landing in Boise, Idaho Thursday evening, but was unable to make it through the night and he passed away at a local hospital.

United Airlines spokesperson Christen David made an announcement following the pilot's death.

"I am sad to confirm that our co-worker passed away last night," David said. "Our thoughts are with his family at this time."

According to NBC News, the co-pilot made the emergency landing with the assistance of a passenger who trains Boeing 747 pilots. Meanwhile, other passengers who were doctors tried to perform CPR on the pilot while the plane made the landing.

The local airport received a call at 7:55 p.m. local time declaring an emergency and notifying them that the pilot had suffered a heart attack. "We've got a man down, chest compressions going on right now," the co-pilot said.

Boise Airport Spokesperson Patti Miller said the plane landed 15 minutes later. The pilot was unconscious when he was removed from the plane and transferred to the local hospital.

Awhile after the plane landed, another pilot boarded the plane to finish the trip from Boise to Seattle. The flight arrived in Seattle at around midnight.

Passengers praised the way United and the flight crew handled the incident.

@mannyseattled tweeted, "Emergency landing in Boise, hope our pilot is OK. Living the professionalism of the flight crew."