Robert Morales is lead by a NYPD Detective to be arraigned for shooting his parole Officer Samuel Salters on his shoulder.Paul Martinka

A convicted killer — quietly waiting to see his parole officer in Brooklyn last night — whipped out a gun when his name was called and fired twice before his weapon jammed, hitting the officer in the right shoulder, authorities said.

“If it didn’t jam, he would have killed the guy,” a source said.

The veteran officer, Samuel Salters, 49 — with the state Parole Division since May 1992 — was rushed to Bellevue Hospital and was in surgery late last night, authorities said.

“He’s OK, thank God,” said a fellow officer.

“He’s a great officer — he’s been around a long time. I’m just here to make sure the family’s OK.”

The ex-con, Robert Morales, 50 — sprung from prison in 2002 on a murder and assault rap for which he served 22 years of a 25-to-life sentence — was immediately surrounded by other officers inside the Downtown Brooklyn office of the Parole Division, authorities said.

“[The suspect] was sitting there quietly like he always does,” said Terrence Cofield, 23, a parolee who witnessed the stunning violence.

“He never speaks to anyone and keeps to himself. Out of left field, he just popped right up when his parole officer called him and shot him right in the shoulder,” the shocked fellow ex-con said.

The mayhem erupted at 7:10 p.m. at the parole offices at 333 Schermerhorn St., near Nevins Street.

Sources said Morales, when called in to see Salters, was escorted by another parole officer. After the ex-con drew and fired his 9mm Ruger, he was surrounded by officers who drew their own guns, and was taken into custody. Charges were pending.

Morales was jailed in February 1979 on a murder and assault rap in Brooklyn. He was released from the Queensboro Correctional Facility in Long Island City in November 2002. Details of the original case were not immediately available.

There is no weapons-screening process at the office where the shooting took place, Cofield said.

“When you walk in, there are two big signs, one in Spanish, the other in English,” with a list of banned items including weapons, he said.

“You see your officer, you give them your daily report and you leave within a half-hour.”

The Parole Division did not have any immediate comment on the security measures.

In a related incident, a responding police car crashed down the block from the shooting, leaving four cops and a parole officer with minor injuries.