A flight attendant died of a heart attack on a flight from Hawaii to New York as frantic crew members pleaded with passengers for help — prompting an emergency landing in California.

The medical emergency forced Hawaiian Airlines Flight 50 from Honolulu to Kennedy Airport to land in San Francisco Thursday night, passengers told Hawaii News Now.

Crew members announced they needed help from someone with medical training while in mid-air.

A doctor aboard tried to save the flight attendant by performing cardiopulmonary resuscitation — but failed, according to the station.

Passengers were distraught, including one New Yorker who tweeted about the in-flight chaos.

“Flight from Honolulu to JFK diverted to SFO for a passenger needing medical attention. It’s been a long time since they asked for doctors to come to first class so I hope they’re okay,” passenger Andrea Bartz tweeted about the ordeal. “First time I’ve ever had a flight diverted, somehow. Waiting for medics to board now.”

Passengers were held on a runway at San Francisco International Airport for nearly two hours as they waited for a medical examiner to arrive, according to Hawaii News Now.

The unnamed flight attendant, who spent 30 years working for the airline, was pronounced dead at the airport, a spokesman for the airport, Doug Yakel, told NBC New York.