Passengers on a United Airlines plane performed CPR on the pilot when he suffered a heart attack mid-flight.
Captain Henry Skillern, of Humble, Texas, was piloting the aeroplane from Houston to Seattle when the emergency occurred on Thursday.
Passengers stepped in to help, with two doctors performing CPR and an off-duty pilot assisting in the emergency landing in Idaho.
Mr Skillern was still alive when he arrived at Saint Alphonsus Regional Medical Centre but sadly died overnight while undergoing treatment, spokeswoman Jennifer Krajnik said.
A Boise airport spokeswoman said he had suffered an apparent heart attack. There were 161 passengers on board.
Passenger Ken Martin told Seattle TV station KOMO a first-year resident doctor sitting next to him volunteered to help perform CPR. She told Martin the pilot appeared to weigh over 300lbs (136 kilos) and was taken into the first class cabin where CPR was performed.
Passenger Bryant Magill described a calm scene onboard.
"I'm really impressed with all the flight attendants," Mr Magill told KOMO. "They kept themselves calm. They kept it professional. There was no panic on the plane."
Ada County Coroner Erwin Sonnenberg performed an autopsy on Skillern late on Friday morning and confirmed that he died at a Boise hospital of a heart attack.
United Airlines spokeswoman Christen David said in an email: "I am sad to confirm that our co-worker passed away last night. Our thoughts are with his family at this time."
Another off-duty United pilot was onboard and helped land the plane.
Pilots are required to get medical certificates that show they don't have major heart problems, according to the Federal Aviation Administration website.
United flight 1603 from Houston to Seattle diverted to Boise for the medical emergency. The flight landed safely and was met by paramedics who took the pilot to the hospital. The Boeing 737-900 had 161 passengers and a crew of six.
Another pilot flew the original plane and passengers to Sea-Tac Airport.
Two Madigan Army Medical Centre doctors onboard performed CPR, according to a spokesman for the hospital at Joint Base Lewis-McChord.