PLAYA DEL CARMEN, Mexico (AP) — Gunfire broke out in a crowded beachfront nightclub throbbing with electronic music before dawn Monday, causing five deaths and setting off a bloody stampede by screaming concertgoers at an international festival in this Caribbean resort.

Quintana Roo state Attorney General Miguel Angel Pech ruled out any terror attack, and the state's governor said it involved a personal dispute. Pech said the shooting erupted when security personnel tried to stop a man from entering the Blue Parrot club with a gun.

Three of those killed were part of the security detail at the 10-day BPM electronic music festival, Pech said. State officials said the dead included two Canadians, an Italian and a Colombian. The gunman apparently fled.

"I was thinking it was the same thing that happened in Paris, some guy just walking in and shooting people at a restaurant, bang bang bang, a terrorist attack," said New Zealand tourist Tyler Klee, who was outside the club when shots rang out.

Pech, the state attorney general, said the 15 people with injuries included a Mexican woman who was seriously injured.

He said eight of the injured, including two U.S. citizens, were treated at hospitals and released. Canada's Global Affairs office confirmed at least one Canadian died and said it was investigating the other reported fatality. It said at least two Canadians were injured. Italy's Foreign Ministry confirmed one of its citizens died.

The shooting occurred near the largest exit, setting off chaos as concert goers had to scramble over a metal fence to escape to the beach.

Jeffrey Castelein, 33, a fork lift operator from Belgium, said he heard 15 to 20 shots before he and his friends leapt the fence. "At first we didn't realize, and then everybody fell down and you had to hide a little bit. And then we went out the back by the sea."

His group got separated and had to wait for everyone to meet back at the apartment. "It was the longest 20 minutes of my life," Castelein said.

Pech said the shooter apparently tried to enter the nightclub about 2:30 a.m., but was denied access because he had a gun. He then began to exchange fire with another person, and festival security personnel who tried to stop the shooting came under fire, Pech said. He said 20 bullet casings from three different pistols were found at the scene, but it was unclear if the security detail was armed or fired any of the weapons.

Pech said the gunman himself apparently escaped, though three people had been detained nearby. It was not known if they had been involved in the shooting.

"We know of another shooting incident that occurred near the nightclub, but we are investigating whether that is related" to the deadly shooting, Pech said.

Quintana Roo Gov. Carlos Joaquin attributed the shooting to "the intolerance and conflict of interests between two people," and also referred to it as "a personal conflict." But he did not specify what the conflict was. He said the two exchanged gunfire.

Playa del Carmen has largely been spared the violence that has hit other parts of Mexico.

The state tourism department said the shooting was an "isolated act of violence" and stressed that "the situation in Playa del Carmen is under control and Mexican and foreign tourists can feel protected and safe."

Without providing nationalities, the state government gave the names of three of those killed. They included Kirk Wilson, who the state identified as the BPM security supervisor at the Blue Parrot, and Daniel Pessina and Rafael Antonio Penaloza Vega.