MEXICO CITY -- Prosecutors in Mexico said on Sunday they caught a gunman who shot an official of the U.S. consulate in the western city of Guadalajara.

The Attorney General’s Office of the western state of Jalisco said in the agency’s Twitter account that the suspect had been turned over to federal prosecutors.

Attacks on diplomats are federal crimes in Mexico.

Get Breaking News Delivered to Your Inbox

U.S. Secretary of State John Kerry issued a statement thanking Mexico for the quick arrest.

“On behalf of President Obama and the people of the United States, I want to thank the Government of Mexico for their swift and decisive arrest of a suspect in the heinous attack against our Foreign Service Officer colleague,” Kerry said. “My thoughts and prayers remain with this officer and his family during this difficult time. I wish him a speedy recovery.”

The U.S. embassy has not identified the official, who was shot in his car Friday in Guadalajara. He was in stable condition Saturday after the attack.

Local media identified him as Christopher Ashcraft, whose profile on social networking sites listed him as a consular officer in Guadalajara since 2016.

The FBI had offered a $20,000 reward for information on the attacker, and surveillance cameras photos of him had been widely circulated.

Jalisco state is dominated by the hyper-violent Jalisco New Generation cartel. There was no immediate evidence of any cartel link to the attack.

The U.S. Embassy in Mexico City urged citizens to limit their movements in the Guadalajara area.

“As the investigation into the January 6 shooting of the U.S. Consulate employee continues, U.S citizens in the Guadalajara area are urged to restrict their movements outside their homes and places of work to those truly essential,” according to the Embassy security message.

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

It was unclear if that was a reference to the apparent stalking of the U.S. consular employee by the gunman, and what appeared to be a direct attempt to kill him.

Surveillance video of the attack shows the gunman following the official in a parking garage. The official was dressed in shorts. The attacker doesn’t appear to try to approach the official while he is walking, but instead waits for him to exit the parking garage in his vehicle and fires a round into the car’s windshield.

U.S. consular employees and other U.S. agents have been attacked in Mexico in the past; the attackers have usually argued the attacks were cases of mistaken identity.