An attack on the government offices in the Mexican beach resort of Cancun has left four people dead, officials say.
Police intervened after gunmen opened fire at the Quintana Roo state attorneys' office. TV showed footage in which intense gunfire could be heard.
One policeman and three suspected attackers died, governor Carlos Joaquin said. Five suspects were arrested.
Mr Joaquin described the attack as a reaction by gangsters to his crackdown on organised crime.
It happened one day after a gunman killed five people in a club in the nearby resort city of Playa del Carmen.
In that incident, Mr Joaquim said the attacker and one of the victims, a man from Veracruz, had a "personal conflict". A Canadian, an Italian and a US citizen were among the dead.
It was not clear if the two attacks were related, officials said.
Gunfire erupted during the attack in Cancun on Tuesday, causing panic on the streets, witnesses said.
A shopping centre was evacuated by security forces after people described hearing gunfire inside. But officials later said it was a false alarm.
Security checkpoints were set up near Cancun's hotel area, some 7km (4 miles) from where the attack happened, local media reported.
The US consulate in Merida urged Americans to follow local authorities' warnings and consult with their hotels before leaving the premises.
Federal forces would be sent to help the local authorities, the governor said, without giving details of how many gunmen were involved in the attack.
Speaking on television in the evening, Mr Joaquin added: "The state is under control and in order...People from Cancun and our visitors can go about their lives as normal."
Quintana Roo, an area popular with foreign tourists, has long been spared from the drug-related violence that afflicts other parts of Mexico.