Nicholas J. Ivie knew that the terrain in the Arizona desert southeast of Tuscon along the Mexican border was among the most active stretches monitored by the U.S. Border Patrol.

“Nick has always been involved in areas with high traffic,” said Brandon Judd, a fellow Border Control agent who worked with Ivie. “He embraced it.”

Ivie, 30, was killed by gunfire on Tuesday after responding to a sensor alarm near Highway 80 about seven miles east of Bisbee, according to the Border Patrol. One other agent sustained non-life-threatening wounds.

Ivie lived with his wife and their two young daughters in Sierra Vista, Ariz., where he was involved with the community and the Church of Jesus Christ of Latter-Day Saints.

Ivie grew up in Provo, Utah, and joined the Border Patrol in January 2008. After graduating from the Border Patrol Academy, he was assigned to the Naco Border Patrol Station. The station was recently renamed after Brian Terry, a Border Patrol agent fatally shot on duty in December 2010.

Tuesday’s shooting occurred about 1:50 a.m., said George McCubbin, president of the National Border Patrol Council, which represents about 17,000 agents.

The Associated Press reported that Ivie and two other agents were fired upon about five miles north of the border while responding to one of the alarms the government has installed along the border. The wounded agent was shot in the ankle and buttocks, the news service reported, and has been released from the hospital after surgery. The third agent wasn’t injured, the news service said. The alarms are meant to guard against smugglers and others trying to enter the United States illegally.

Reuters, citing Mexican officials, reported Wednesday that two men suspected of involvement were arrested in a Mexican city a few miles from the site of the shooting.

Ivie “was just outstanding in every regard,” said Judd. “He wanted to go to work every day. He loved his job, loved people, and didn’t shy away from talking to people.”

The killing “stands as a reminder of the dangers that agents . . . face very day,” Tuscon sector acting chief patrol agent Manuel Padilla said in a statement.

President Obama expressed thanks for Ivie’s “selfless service to his nation” in a call to his family Tuesday, according to a White House statement.

In the past five years, 13 border agents have been killed in the line of duty. Injuries from vehicle accidents have been the cause of many of the deaths.