A Homeland Security agent shot himself in the leg Wednesday while letting off some rounds at a gun range in The Bronx, cops said.

The agent was at the Rodman’s Neck Outdoor Range in Pelham Bay Park when he accidentally pumped a bullet into his left leg, according to police.

The incident happened around 5:15 p.m., cops said.

Paramedics rushed the agent to Jacobi Medical Center and he was expected to survive.

The Rodman’s Neck firing range is used by NYPD members and other law enforcement agencies. The training facility sits on a 54 acre stretch of land on the Rodman’s Neck peninsula.