Suffolk County police confirm the shooting happened in an area off limits to the general public inside the courthouse between 9 a.m. and 10 a.m.
It preliminarily appears the officer accidentally shot himself in the arm in a third floor room.
He was taken to Stony Brook University Hospital for treatment of a non-life threatening injury.
Court security officers provide security functions inside federal courthouses, including operating screening equipment and conducting routine patrols of courtrooms.
The court security officers tend to be retired law enforcement officers with experience to assist the U.S. Marshals in securing the federal buildings.
It is unclear if the feds will be taking over the investigation, since the incident happened on federal property.