(CNN) A man has been killed in a horse race at a birthday party that hit the headlines after an invitation went viral on Facebook.

The teenager's parents accidentally made the invite a public post and by Christmas 1.3 million people had replied -- and thousands turned up to Rubi Ibarra Garcia's 15th birthday in central Mexico's San Luis Potosi state.

But the celebrations turned to tragedy Monday when Felix Pena, a 66-year-old man who regularly raced horses and worked at a local stable, was trampled during the race, according to the local attorney general.

"I'm not doing it for the money, I'm doing it for the fame and glory," he had said.

Another man was taken to hospital with a broken leg after falling into the horses' path.

Medics at the scene say that Pena died en route to the hospital.

It is unclear why he stepped into the line of galloping horses. According to the local authority, an investigation has been opened.

Invite goes viral

Earlier this month, Rubi Ibarra Garcia was just another girl preparing to celebrate her quinceañera, a birthday party akin to a "sweet sixteen" -- but for 15-year-olds -- and celebrated in many Latin American cultures.

But when a video uploaded to Rubi's Facebook page inviting family and friends to the party was accidentally set as a public post it went viral, and Rubi and her parents were quickly catapulted into the spotlight.

In the 45-second clip, Rubi's father Crescencio Ibarra said: "We invite you on December 26 to our daughter Rubi Ibarra Garcia's quinceañera in La Joya."

He then announces the party's events -- including the horse race -- that would have seen the winner taking home a cash prize of 10,000 pesos (about $485.)

He closes the invitation with the now famous last words: "Everyone is cordially invited."

The teenager's family didn't think that their open invitation would be taken up by so many.

Huge preparations for party

The family fought throngs of reporters and guests as they made their way into church earlier in the day for a private Mass.

Later in the evening, Rubi, dressed in a fuchsia floral gown and a tiara, danced and shook hands with some of the guests.

Photos: The birthday party where everyone was invited Rubi Ibarra makes her way through the crowd to her birthday Mass at her Quinceanera party on Monday. Millions of people responded to the invitation in rural Mexico after her parent's video asking "everybody" to attend went viral. Hide Caption 1 of 6 Photos: The birthday party where everyone was invited Rubi Ibarra wears an elaborate fuchsia dress and gleaming tiara at her Mass. Hide Caption 2 of 6 Photos: The birthday party where everyone was invited Thousands of party go-ers attend Rubi's birthday party in Joya, San Luis Potosi State, Mexico. Hide Caption 3 of 6 Photos: The birthday party where everyone was invited Guests have their picture taken behind a frame at Rubi's birthday party. Hide Caption 4 of 6 Photos: The birthday party where everyone was invited Crowds enjoy the festivities at the Rubi Ibarra birthday party. Hide Caption 5 of 6 Photos: The birthday party where everyone was invited Heavy traffic blocks a road as visitors try to get to the Rubi Ibarra birthday party.

Hide Caption 6 of 6

In addition to the horse race, there was a dinner and a show with local bands. There was even a huge billboard welcoming guests.

In the lead up to the party, Rubi and her family made TV appearances, Mexican airline Interjet offered discounted tickets to the nearby airport, designers sent free dresses, and Spotify uploaded a special playlist for the big day. Local police also deployed extra security for the event.

¡Asiste al evento del año y regresa con el premio a casa! 🐐 https://t.co/YfLLwaJkhA pic.twitter.com/Qiq9ogvMNg — Interjet (@interjet) December 5, 2016

La última con Marcoflores y la Jerez mil gracias por haber asistido a mi inolvidable fiesta ❤ #Rubiibarra A photo posted by Rubi Ibarra Garcia oficial (@rubibarraoficial) on Dec 27, 2016 at 4:29am PST