A man was shot to death Thursday night during a struggle with a U.S. Border Patrol agent near the Arizona-Mexico border, officials said Friday.

Agents were tracking a group of illegal immigrants about 8:30 p.m. near Apache, near Arizona 80. Two people were apprehended without incident, but a third person ran away, Carol Capas, a spokeswoman for the Cochise County Sheriff's Department said in a news release.

The man was found a short time later hiding under a mesquite and began to fight with the agent, Capas said. The man also tried to take the agent's gun, which prompted the agent to grab his weapon and shoot the man, the release says.

Customs and Border Protection corroborated the account from the Cochise County Sheriff’s Office and directed all calls to them since they will be leading the investigation.

Since 2005, on-duty Border Patrol agents and Customs and Border Protection officers have killed at least 42 people, including 13 Americans, The Arizona Republic has reported — four deaths have happened in Yuma and 13 in Tucson sector.

The last known deathly shooting in the Tucson sector happened Decemeber 2012, when a Border Patrol agent in the Baboquivari Mountains killed an apparent illegal immigrant - 19-year-old Guatemalan Margarito Lopez Morelos — who, the agency said, struggled with an agent.

The man shot and killed Thursday is believed to be in his 20's. The man's body was taken to the Pima County Medical Examiners Office. He has not been identified.

The other two individuals apprehended are Mexican nationals who were in the country illegally.

The Mexican Consulate was notified of Thursday's shooting.

Capas said her office had no information the agent was seriously injured in the fight.