Gunfire broke out in a crowded beachfront nightclub in Mexico, causing five deaths and setting off a bloody stampede by screaming concert-goers.
The attack happened in the Caribbean resort of Playa del Carmen before dawn on Monday.
At least one person died in the crush to escape and some of the 15 people wounded or injured were hurt as people rushed out, the authorities said.
Quintana Roo state Attorney General Miguel Angel Pech ruled out any terrorism motive, and the state's governor said it involved a personal dispute.
Mr Pech said the shooting erupted at about 2.30am local time when security personnel tried to stop a man from entering the Blue Parrot club with a gun.
The gunman began to exchange fire with another person, and festival security personnel who tried to stop the shooting came under fire.
Mr Pech said 20 bullet casings apparently 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.
Three of those killed were part of the security detail at the 10-day BPM electronic music festival, he said. The gunman apparently fled.
He said three people were detained nearby. It was not known if they had been involved in the shooting.
Quintana Roo Governor Carlos Joaquin attributed the shooting to "a personal conflict" between two people who exchanged gunfire.
New Zealand tourist Tyler Klee was outside the club when shots rang out.
He said: "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.
"Everyone ran, everyone was terrified, looking for their friends ... We were running away and then you hear more shots fired, like you don't know if you're going to be shot in the back or not."
Officials released a list of the dead, who included one Canadian, one American, two Mexicans and one Italian.
Canada's Global Affairs Department identified its dead citizen as Kirk Wilson of Toronto.
Neil Forester, a friend, said Mr Wilson was a veteran bouncer and was working with security at the festival to lend a hand to the Canadian organisers.
"He was just a genuine, one-of-a-kind guy," Mr Forester said. He said Mr Wilson was 49 and was married with two children.
The Quintana Roo state prosecutor's office identified the US citizen who died as Alejandra Villanueva Ibarra.
The office said she died in the crush to escape the shooting.
It identified the Italian victim as Daniel Pessina and said he was part of the BPM staff.
The Mexican victims were identified as Rafael Penaloza Vega and Geovanni Ruiz Murillo. The prosecutor's office said Mr Ruiz Murillo was wearing a BPM shirt.
Mr Pech said a Mexican woman was seriously injured, and that eight of those hurt were treated at hospital and released.
The shooting occurred near the largest exit, causing 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 realise, and then everybody fell down and you had to hide a little bit. And then we went out the back by the sea."
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".