A UK woman died on Wednesday just minutes before it was scheduled to depart from Palma Airport in Majorca.
A Ryanair spokesperson said: "This flight from Palma to Edinburgh was delayed ahead of take-off after a customer became ill prior to departure."
"Paramedics boarded the aircraft after medical assistance was requested but the customer sadly passed away," the spokesperson added. "Ryanair extends its deepest sympathies to the bereaved and is providing any assistance required."
The flight later departed three hours later after disembarked customers were allowed to board.
The Foreign Office said in a statement: "Our consular staff are supporting the family of a British woman following her death in Spain."
An autopsy will be conducted on Thursday to determine the cause of death, according to local media reports. Ryanair faced a similar incident in 2015 after Bolton-native Davina Taverner collapsed in the toilets of a flight bound for Lanzarote after suffering heart problems.