An off-duty NYPD detective and his cop girlfriend were attacked by a rowdy pack of Brooklyn teens — because the couple asked the group to stop jumping on parked cars, prosecutors said Tuesday.

“I’ll kill a cop. A cop is going to die tonight,” Joseph Nacmias, 17, barked at Detective Daniel Alessandrino when the officer identified himself as NYPD during the Feb. 8 confrontation outside his Bensonhurst home, according to the Brooklyn DA.

Nacmias and three alleged cohorts — Jason Chalhon, 17, Vito Morgera, 17, and Michael Peterson, 17 — then pummeled the detective, who once was a part of then-Police Commissioner Ray Kelly’s ­security detail, prosecutors said.

The four teens were indicted Tuesday on assault charges.

Alessandrino and Jaline Bernier first encountered the teens shortly before midnight as the gang and more than a dozen pals were “making a lot of noise and banging and jumping on cars,” prosecutors said.

Alessandrino said he didn’t want trouble and asked the teens to move along, but Nacmias, 17, allegedly replied, “What are you going to do? Call a cop?”

Alessandrino replied that he and Bernier were NYPD officers.

Nacmias then made his cop-killing comment and punched Alessandrino, prosecutors said.

When the detective shoved Nacmias back, the punk attacked Bernier, according to prosecutors.

Nacmias and his co-defendants then shoved the detective to the ground and kicked and punched him while stomping on his head, according to court papers.

Alessandrino suffered swelling and cuts to the face, head, arms and legs, plus broken teeth.

Bernier suffered a swollen eye and facial pain, prosecutors said.

“At this point, he’s still recovering from his wounds and he’s satisfied with the indictment of those ­involved,” said a police source.

The rowdy teens had been at a party a few blocks away, a law- ­enforcement source said.

The arrested teens, who are all from Mill Basin and have no prior criminal records, each face up to seven years in prison. They were released without bail at their arraignment last month.

Defense attorneys for Nacmias and Morgera — who also allegedly had marijuana in his possession — declined to comment while an attorney for Peterson didn’t return a call for comment.

Chalhon’s lawyer, Joe Mure Jr., said, “He may have been there but he wasn’t involved in the fight.”

Detective-union President Michael Palladino said, “Teens spewing such hate and viciously attacking the detective indicates they have no respect for the law, which is a terrible reflection on the parents.”

Additional reporting by Shawn Cohen