PHOENIX (AP) — A man suspected of illegally entering the U.S. grabbed a border agent's gun in a struggle and was fatally shot by the agent's partner, the U.S. Border Patrol said Thursday.

The shooting happened in a remote area of Arizona south of Tucson on Wednesday as the agents were trying to arrest the man among of a group of Guatemalan nationals who authorities believe were in the country illegally, said Tucson Sector chief patrol agent Rodolfo Karisch.

"The assailant wound up on top of the agent, was able to pull his weapon from his holster at which time the other agent came up and shot the individual," Karisch said.

He said the agent who opened fire saved his partner's life, calling him "heroic."

The agent who struggled with the man suffered minor injuries, Karisch said.

The agents and the man were not identified.

The two agents had been tracking the group of men about 21 miles (34 kilometers) north of the U.S. Mexico border.

Three in the group were arrested. Authorities were searching for the rest in the Baboquivari Mountain Range.

The shooting was being investigated by the FBI, U.S. Customs and Border Protection and Tohono O'odham Nation police.

The incident illustrated the daily threats that agents face, Karisch said.

Last June, a 76-year-old Tombstone man barreled into a Border Patrol checkpoint in southern Arizona and shot at agents before they fired back.

Gary Smith was indicted on charges of assault of a federal officer and use of a firearm in a crime of violence. He was previously struck in the arm after a shootout with Border Patrol agents a month earlier at a checkpoint near Tombstone. No agents were injured. According to court documents, he was recently treated at a mental health facility.

In Texas, a Customs and Border Protection agent was fatally injured Nov. 18 about 110 miles (175 kilometers) southeast of El Paso.

But a local sheriff believes Agent Rogelio Martinez and his partner were hurt in an accident, not an attack. Culberson County Sheriff Oscar Carrillo told The Dallas Morning News on Thursday that the agents, who were found along a culvert next to Interstate 10, may have been sideswiped by a passing tractor-trailer.