Agent Nicholas Ivie, 30, was fatally shot after responding to a tripped sensor near the border. Ivie was a native of Provo, Utah and worked for the Border Patrol for two years.
According to the Border Patrol, the shooting happened at 1:50 a.m. MT. Ivie and two other agents were together in their patrol area when they responded on horseback to a motion sensor that was tripped along the border. That's when gunfire erupted. It is unclear if the agents were ambushed or if an actual gun battle occurred.
"First and foremost, our thoughts and prayers are with Agent Ivie's family during this terrible time," Jeffrey D. Self, commander of the Joint Field Command -- Arizona, said in a statement. "This is a tragic loss for Customs and Border Protection. We have an unwavering commitment to pursue and bring the perpetuators of this heinous act to justice."
The wounded agent was shot in the ankle and buttocks and was airlifted to a hospital with non-life threatening injuries. He was reportedly in stable condition Tuesday afternoon. The third agent was unharmed.
An investigation into the shooting is being handled by the Federal Bureau of Investigation and the Cochise County Sheriff's Office.
Cochise County Sheriff's officials said that because of the location and time of the shooting, drug trafficking may have been a factor, but that is merely speculation at this point. It's also unclear if there was more than one shooter.
The last Border Patrol agent fatally shot on duty was Brian Terry, who was killed in a shootout with Mexican bandits near the border in 2010. That shooting was later linked to the government's "Operation Fast and Furious" gun-smuggling operation.
The operation allowed people suspected of illegally buying guns for others to leave gun shops with weapons that were intended to be tracked into Mexico. Two rifles found at the scene of Terry's shooting were purchased by one of the people being investigating for the gun-smuggling.
Cochise County Sheriff's officials said it was not immediately known if the weapons used in Tuesday's shooting were related to Operation Fast and Furious.
In a statement, Terry's family sent out condolences to the families of the two agents, saying the shooting is a reminder of the dangers border patrol agents face.
Ivie, who is married, lived in Sierra Vista with his wife and their two young daughters.
The patrol station in Naco that the three agents worked out of was recently named after Terry.
ABC News and the Associated Press contributed to this report.