Eddie Colon, 49, attacked a woman he knew in a Brownsville residence, beating her, raping her, and blocking her from breathing, all while still wearing his loaded sidearm, an NYPD spokesman said.
The woman was evaluated at a hospital, but the extent of her injuries was unclear, police said.
Police arrested Colon about 2 a.m. Wednesday within the 73rd Precinct, according to the NYPD.
Colon, who had worked for the Department of Correction since 1991, was suspended from his current position in Bellevue's prison ward, sources said.
He is expected to be charged with rape, criminal use of a firearm, criminal possession of a loaded firearm, unlawful imprisonment, assault, criminal obstruction of breathing, and menacing, police said.
The extent to which Colon and the woman knew each other is still being investigated, though a police spokesman said she was not his wife or girlfriend.
Investigators were trying to determine if the attack was an isolated incident.