Ulises Lara López, a spokesman for the attorney general's office, told reporters at a news conference that two men -- ages 18 and 21 -- died in the crash. The two men sustained head and other injuries when the car derailed, according to officials.
Two women -- ages 27 and 35 -- were also injured in the crash. One of the women had a leg injury that required surgery, while the second woman had a severe brain injury that required her to be intubated. She is listed in serious condition, officials said in a news release.
Witnesses told local media outlets the victims were sitting in the last car of the roller coaster as it derailed. Video obtained by Mexican news outlet Milenio shows the moment the car derails as the roller coaster train enters a tight turn.
Rosalba Rodriguez, who witnessed the crash, told reporters there was nothing out of the ordinary about the ride, which had completed a few loops until the last car derailed during a turn near the end of its run.
A preliminary investigation has indicated a mechanical failure caused the car to come loose and fall from a height of 33 feet above the ground, according to López.
Investigators were treating the derailment as a case of negligent homicide.
"This is now in the hands of prosecutors, and prosecutors have already taken the necessary steps for an investigation," Miriam Urzua, an official from the civil protection organization, told Reuters news agency.
The popular park closed shortly after the crash, as the fair said it "deeply regrets the terrible accident" and is investigating, Sky News reported. Video showed investigators milling around the park as a tarp on a frence blocked a view of the area under the roller coaster where the derailed car crash-landed.
The towering Quimera coaster in Chapultepec Park can be seen from afar in the capital, it's three nearly vertical yellow and red loops visible from a major highway.
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.
The Associated Press contributed to this report.