Five other assailants were detained, Gonzalez said, urging the federal government to send reinforcements.
The gunfight caused panic in the Caribbean coast city, a day after three foreigners and two Mexicans died in a shooting at an electronic music festival in the nearby seaside resort of Playa del Carmen.
While it was not known whether the two shootings were linked, the back-to-back attacks broke the peace in a region that is popular among American, Canadian and European tourists and has avoided the sort of drug-related violence that has plagued other parts of Mexico.
"The only thing that (the shootings) reveal is that we are going in the right direction and we won't lower our guard," Gonzalez said.
State security chief Rodolfo del Angel had earlier reported the deaths of a gunman and two prosecutor's office staffers but the governor later provided a different toll.
Angel said in a video message on Twitter that authorities activated "code red" after the shooting -- a security protocol combining state and federal police and the army -- but he insisted that the situation was under control.
The clash took place seven kilometers (four miles) away from the hotel area. Local media said authorities set up three checkpoints near the tourist zone.
"At the moment the state is peaceful, the citizens can remain calm, Cancun is doing well at this moment," he said.
The motive for the attack was not immediately known.
The US Consulate in Merida issued a security message urging Americans to "follow local authorities' warnings and consult with their hotels before leaving the premises."
Mexican television showed footage in which intense gunfire could be heard. Soldiers and police guarded the prosecutor's office after the shooting.
State attorney general Miguel Angel Pech was not in the building at the time.
Sandra Ramirez, a 33-year-old maid who lives seven streets away from the prosecutor's office, said she could hear the gunfire and "explosions" woke her up from her nap.
"I went out later and police were reviewing every car that was going by," Ramirez told AFP by telephone.
In the past, she said, "things have happened, a dead person has appeared here or there, but never something like this."
Several stores were closed and the streets were deserted, she said.
A store manager at the Plaza Las Americas shopping center, at the start of the hotel zone, told AFP on condition of anonymity that shots were heard inside the mall and that people tried to hide in the shops.
"The soldiers came, cordoned off the area and began to evacuate people. They told us that the shots were part of the chase" against the assailants, the manager said.
Nightclub attack: drug link?
Meanwhile, authorities were investigating the motive behind Monday's pre-dawn shooting at the Blue Parrot club during the BPM music festival in Playa del Carmen, 68 kilometers (42 miles) to the south.
Drug cartels have not perpetrated the same brutal violence seen in other states, but dealers often offer narcotics to tourists in the town.
The shooting "could be a case of small-time drug dealers fighting for control" of turf, Pech told the Televisa network.
Pech said a gunman fired five times at a Mexican man at the club and the victim's bodyguards or other people fired back.
When the shooter fled the club, he hit another person who was also armed and whose gun went off when he fell, wounding other people, Pech said.
A Canadian man and an Italian man, both of whom worked for the BPM electronic music festival, and the Mexican man, died from bullet wounds.
An American woman was trampled to death in a stampede as people fled the club in panic. Fifteen other people were hurt.
Four people were detained but officials have not said if the shooter was among them.
Officials are also investigating whether the incident was linked to a dispute over an extortion racket against the club, or because the dealers were not allowed to sell drugs inside the club.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)