Guadalajara (Mexico) (AFP) - The Mexican authorities have arrested the alleged gunman who shot and wounded an official from the US consulate in the western city of Guadalajara, prosecutors said Sunday.

The official was shot on Friday in a brazen attack by a man wearing a black wig and a blue nurse uniform outside a shopping center's garage in Mexico's second biggest city.

A special unit "detained the attacker of the consular official," the Jalisco state prosecutor's office said on Twitter, without specifying when he was caught or a possible motive for the attack.

The suspect was handed over to the federal attorney general's office, the state authorities said.

The FBI, which is helping in the investigation, had offered $20,000 for information about the shooter's identity.

The consular official was in stable condition on Saturday.

- US embassy urges caution -

The US consulate in Guadalajara posted surveillance camera footage showing the official, dressed in shorts and a sleeveless shirt, paying a parking ticket at an automated machine. The gunman is then seen following him.

Another security camera shows the gunman later standing outside the garage. When the official's black car stops at the exit, the shooter raises his gun and opens fire.

A bullet hole is seen on the windshield and the official opens his door before the footage ends.

A US government official said the American is a vice consul.

Jalisco's state attorney general, Eduardo Almaguer, said the consular official interviews visa applicants. On Saturday, he described the shooting as a "direct attack."

US Secretary of State John Kerry thanked the Mexican government for the "swift and decisive arrest of a suspect in the heinous attack against our Foreign Service Officer colleague."

"The safety and security of US citizens and our diplomatic staff overseas are among our highest priorities," Kerry said in a statement, adding that he wished the official a "speedy recovery."

Guadalajara and the rest of the state have been hit by violence perpetrated by the powerful Jalisco New Generation drug cartel in recent years.

Story continues

The latest attack prompted the US embassy to issue a security message on Saturday urging US citizens in Guadalajara to "restrict their movements outside their homes and places of work to those truly essential."

"They should also take care not to fall into predictable patterns for those movements that are essential," the message continued. "They should vary the times and routes of their movements."

- Previous attacks -

US officials have faced attacks in Mexico in the past.

In 2010, a consular official, her husband and the spouse of another consular official were killed in the northern city of Ciudad Juarez, which at the time was considered the world's murder capital amid an ultra-violent drug war.

An alleged leader of the Barrio Azteca gang was extradited to the United States, where he was sentenced to life in prison for ordering the murder.

A year later, gunmen from the Zetas drug cartel opened fire on a vehicle of two US Immigration and Customs Enforcement (ICE) agents in the northern state of San Luis Potosi, killing one of the officers.

In 2012, two US officials -- widely reported to be CIA agents -- and a Mexican marine where wounded when they were shot at by federal police officers as they were driving in the central state of Morelos.

Fourteen officers were charged with using excessive force, with officials citing a case of mistaken identity.

And in a case that caused friction between the US and Mexican governments in 1985, undercover US agent Enrique "Kiki" Camarena was tortured and killed by the Guadalajara drug cartel.