The agent was trying to stop a group of people suspected of crossing the border illegally from Mexico when the man who threw the rock at the bottom a 75-foot ravine was shot, San Diego County sheriff's Lt. Glenn Giannantonio said. The man was pronounced dead at the scene after first-aid efforts failed.
The agent declined to be treated at a hospital for an injury that the sheriff's lieutenant described as minor. The agent and the man who was shot were not immediately identified.
The Border Patrol said in a statement that the agent feared for his life. Two other people in the country illegally were arrested and detained, the agency said.
Two Border Patrol agents on foot had separated to cut off the group, and one of the agents was hit in the face with the rock, prompting him to fire, Giannantonio said. He didn't know how many times the man was shot.
The Border Patrol said the agent was attacked with rocks, including one that hit him in the head.
The shooting, which took place about 6:30 a.m. four miles east of San Diego's Otay Mesa border crossing, occurred amid debate over whether lethal force is justified as a response to rock attacks. The Border Patrol has long maintained that rocks are deadly weapons.
The Police Executive Research Forum, a nonprofit group that led a government-commissioned review, has recommended that the Border Patrol and its parent agency, Customs and Border Protection (CBP), prohibit deadly force against rock-throwers and assailants in vehicles, Border Patrol Chief Mike Fisher told The Associated Press last year. CBP rejected the proposed curbs, which Fisher called "very restrictive."
Under current policy, agents can use deadly force if they have a reasonable belief that their lives or the lives of others are in danger.
Agents were attacked with rocks 339 times in the 2011 fiscal year, more than any other type of assault, according to the Department of Homeland Security inspector general. They responded with gunfire 33 times and with less-than-lethal force a category that includes pepper spray and batons 118 times.
Rock attacks fell to 185 in the 2012 fiscal year, becoming the second most common type of assault. Agents fired a gun 22 times and responded 42 times with less-than-lethal force.
The San Diego County Sheriff's Department is leading the investigation into Tuesday's shooting.
A spokesman for the union representing Border Patrol agents said he was confident the investigation would find the agent did nothing wrong.
"The easiest way to stop these incidents from happening is to stop attacking Border Patrol agents," said Shawn Moran of the National Border Patrol Council.
Mitra Ebadolahi, an attorney for the ACLU of San Diego and Imperial counties, said there wasn't enough public information to say if the agent was justified but that the episode raised familiar questions about whether the Border Patrol can respond to rock attacks with nonlethal force.
She said she was troubled that there appeared to be no independent witnesses.
"It's imperative for the agency to behave honestly and transparently," Ebadolahi said.