ATF agents conducting an undercover operation Friday afternoon in West Baltimore shot an armed man who approached their vehicle in an apparent robbery attempt, police said.

The shooting occurred about 3 p.m. when two armed men approached three agents for the federal Bureau of Alcohol, Tobacco, Firearms and Explosives who were in a pickup truck, police said.

The man who was shot was taken to an area hospital for surgery, while a second man managed to flee, the Baltimore Sun reports.