CANCUN, Mexico --A gunman killed at least five people and wounded nine others at a nightclub in the Caribbean coast resort of Playa del Carmen during a music festival, officials said Monday.

Two Canadians, an Italian and a Colombian are among the dead, authorities said. CBS News partner network UNO TV reported that, according to Quintana Roo state prosecutor Miguel Ángel Pech, there were no Americans known to be among the victims of the attack.

Pech said that three of the dead were part of the security detail at the 10-day BPM electronic music festival. The fourth and fifth victims have not been identified.

Get Breaking News Delivered to Your Inbox

Pech said a lone gunman apparently tried to enter the nightclub, but was denied access because he had a gun.

The gunman began to exchange fire with another person inside, he said, and festival security personnel tried to stop the shooting and came under fire.

Pech said it was not a terrorist attack, and said three people had been detained nearby, but it was unclear 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 nightclub shootings,” Pech said.

He said 20 bullet casings from three different pistols had been found at the scene, and said it was unclear if the security detail had been armed or fired any of the weapons.

The Blue Parrot nightclub where the shooting occurred was hosting an event that was part of the BPM electronic music festival. The event where the shooting occured was reportedly the closing event of the festival.

The shooting apparently caused a rush of people heading for the exits at the beach-side club, and the lone female victim was apparently killed during the stampede.

Pech said 15 people were injured, included one Mexican woman who was seriously injured. He said eight of the injured -including two U.S. citizens and one Canadian -had been treated for less serious injuries at local hospitals and released.

He said three people had been detained nearby, but it was unclear if they had been involved in the shooting.

Rodolfo Del Angel, director of police in the state of Quintana Roo, told the Milenio TV station that he shooting was the result of “a disagreement between people inside” the nightclub and said security guards had come under fire when they tried to contain the dispute.

The BPM Festival posted a statement saying four people had been killed and 12 injured in an attack that involved “a lone shooter.”

BPM wrote that “the violence began on 12th street in front of the club and three members of the BPM security team were among those whose lives were lost while trying to protect patrons inside the venue.”

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

Canada’s Global Affairs office confirmed the death of one Canadian and said it was investigating reports of another. Italy’s Foreign Ministry confirmed one its citizens died.

German dance music producer Sidney Charles tweeted that he had been DJing when the shooting began. Other music producers also tweeted to let fans know they were safe, and express sadness and anger over the attack.

I was on the decks while shootings happened at blue parrot...me and my friends are safe. What a tragedy... — Sidney Charles Music (@SidneyCharlesM) January 16, 2017

One musician said on Twitter that the gunman had managed to enter the club, but that was not confirmed by any official sources.