When the last car on the ride derailed at the La Feria theme park, two men aged 18 and 21, died from head injuries and other wounds, according to the Mexico City attorney general’s office.
Video shared on social media showed the car flipping nearly upside down and smashing into a metal loop on the Quimera rollercoaster.
Images from the aftermath of the accident showed first responders attending to victims and a single metal rail car on the ground, on its side, near blood stains.
Preliminary investigations have indicated a mechanical failure caused the car to come loose and fall from a height of 10 metres, said Ulises Lara Lopez, a spokeperson for the attorney general's office.
Authorities are treating the accident, which also injured two women, as a case of negligent homicide.
The women, reportedly 27 and 35 years old, were transferred to Mocel Hospital in the city where they were to be in a stable condition, a statement from the local government said.
It added that it would provide support for the families of the victims and said it was committed to conducting an investigation “quickly and transparently”.
The Feria amusement park will be closed from one to two weeks until an investigation can be completed following the accident, the local newspaper El Universal reported.
A vendor at the park told the newspaper that she saw a passenger thrown from the car, and that other riders hit their heads as the rollercoaster advanced at high speed while dragging the final car.
The decades-old coaster, like many rides in La Feria, was featured at other parks around the world before finding a home in Mexico City.
Agencies contributed to this report