It happened at the intersection of 20th Street and JFK Boulevard at 9:00 Monday night.
Police say they arrested a suspect nearby on Arch Street.
The federal officer was treated at a nearby hospital.
Authorities have not disclosed the officer's name or the agency for which the officer works.