(bbc) -- Rocío Cortés Núñez, 25, had just given birth by Caesarian section in Seville's Our Lady of Valme hospital when the incident occurred on Sunday.
Her hospital trolley was being wheeled out of the lift when it began to rise with its doors open, leaving part of her body hanging outside.
Firefighters were called to rescue her but she could not be saved.
Some reports say her head was severed.
Family is 'devastated'
Ms Núñez had two other children, aged four and five, and her newborn daughter - who was with her at the time - was not harmed.
Her brother-in-law David Gaspar said that the family wanted to know why safety systems appeared to have failed. He added the accident was hard to believe.
Ms Núñez's husband, José Gaspar, said he was devastated by what had happened.
"This can't be so. Today it was Rocío but tomorrow it could be someone else," he told ABC Sevilla.
Regional health minister Marina Alvarez has opened an investigation but told reporters that the lift had passed safety tests earlier this month.
She called it a "rapid, unusual and tragic" accident.
A porter was reportedly moving Ms Núñez to a maternity ward when the doors on the lift they were in opened and closed a few times.
But as he attempted to wheel her out of the lift to try another one, it began to rise, trapping her.