NEWARK -- Authorities say the off-duty Jersey City police officer who shot and killed two men Sunday night was in Newark with a friend when the duo attempted to rob him at gunpoint.

At about 11:30 p.m., the officer was in the 100 block of South 6th Street in Newark dropping off an acquaintance and two children when he was approached by the two armed men, Acting Essex County Prosecutor Robert Laurino said in a release Monday.

One of the men apparently tried to shoot at the officer but his gun jammed, the prosecutor's office said.

The officer shot both men -- identified as Dante Holden, 19, of and Tymyr Wilson, 21, both of East Orange -- and both were pronounced dead at the scene, Laurino said.

Officials declined to identify the officer involved.

A spokeswoman for Jersey City Monday issued a statement on the incident.

"We are thankful that our detective, who was a victim of an attempted armed robbery, is OK and want to thank the Newark Police Department and the Essex County Prosecutor for their assistance in this ongoing investigation," said city spokeswoman Jennifer Morrill.

She declined to answer any additional questions about the officer.

In keeping with Attorney General guidelines, details of the investigation into the incident will be presented to an Essex County grand jury.

The shooting is the latest of several similar incidents in the city. Last month, a corrections officer fired his gun while confronting a man allegedly attempting to break into the officer's parked car. In November 2016, a retired NYPD detective shot two men who allegedly tried to mug her. Last month, a Newark police officer shot a carjacking suspect after a chase with an allegedly stolen BMW. None of those shootings were fatal, but several police shootings in Newark this year have been.

Anyone with information on this shooting is asked to call the Essex County Prosecutor's Office Professional Standards Bureau at 862-520-3700.

Jessica Mazzola may be reached at jmazzola@njadvancemedia.com. Follow her on Twitter @JessMazzola. Find NJ.com on Facebook.