Afghan officials say the U.S. military has handed over six Afghan villagers who were detained during a raid early Tuesday at a compound where troops discovered bomb-making materials.

The raid near Bagram Air Base and the subsequent arrests sparked a violent protest by several hundred locals who demanded their release. They said U.S. troops arrested the villagers without consulting local authorities.

Afghan Officials: US Military Hands Over Detained Afghans

U.S. soldiers fired warning shots outside the air base after some protesters threw stones at military vehicles and tried to push down the base's outer gate. No casualties were reported.

Afghan Officials: US Military Hands Over Detained Afghans

The U.S. military said those arrested were suspected of planning attacks against U.S.-led forces.

Afghan Officials: US Military Hands Over Detained Afghans

This latest incident at Bagram came amid an upsurge in violence ahead of September's parliamentary elections in Afghanistan.