The accident happened at La Feria amusement park in the capital Mexico City. (Representational)

Two people were killed and two more injured when a rollercoaster carriage derailed at a theme park in Mexico, authorities have said.

Early reports suggest a mechanical problem caused the carriage to become detatched from the ride and fall some 10 metres to the ground, the public prosecutor said in a statement.

It is believed the two men died as a result of head injuries, it added, while two woman were taken to hospital -- one of them in a serious condition.

The accident happened at La Feria amusement park in the capital Mexico City on Saturday.

In a Twitter post, the theme park said it "deeply regrets the terrible accident" and it has launched an investigation into the incident.