Police say the officer, identified as 32-year-old Michael Morgan, was shot outside a strip club on Getty Avenue just after 3 a.m.
He was rushed to St. Joseph's Hospital, located just down the street from the club, where he later died.
"Our condolences go out to the family of Detective Michael Morgan," Mayor Cory Booker said. "Detective Morgan was a proud and courageous servant of our city. His loss is tragic, and the circumstances of his death make it all the more painful. Our prayers are with his family and all who knew and loved this great man."
Morgan was apparently inside the strip club with friends and was leaving when he stopped outside to talk to one of the dancers. Both were then approached by an armed man who police say had just pulled off a robbery a few blocks away.
Witnesses said the suspect was grabbing for the woman's purse. When the detective intervened, he was shot.
The suspect fled on foot. No arrests were immediately made. It's unclear if Morgan ever had a chance to identify himself as a police officer.
Police cordoned off the area as the search for the suspect continues.