Update: This story has been updated to include comments from Jersey City Police Officers Benevolent Association President Carmine Disbrow.

A judge was critical of the way Jersey City police handled an incident in which a man was shot multiple times after throwing a fence post at officers minutes after police tore down a memorial to Police Officer Melvin Santiago's killer.

"Something is rotten in Denmark," said Hudson County Superior Court Judge Martha Royster at a hearing on Friday to determine if Mark Highsmith, 27, should be allowed into the pretrial intervention program.

Highsmith was shot multiple times by police at 2:30 a.m. on July 15, 2014 at Martin Luther King Drive near Kearney Avenue -- two days after Santiago was gunned down by Lawrence Campbell after responding to a report of a robbery at a Jersey City drug store. Campbell was shot dead when police returned fire.

"It disturbs me that every time we have misconduct by police officers or inappropriate behavior or rash judgments that the response is that they are acting under pressure," the judge said. "You are trained. You chose the job when you took it. You are supposed to be learned on how to defuse situations. You are supposed to understand how to deal with the community. You have training on how to deal with unarmed individuals and armed individuals."

Jersey City officials declined to comment, citing the ongoing litigation.

However, Carmine Disbrow, president of the Jersey City Police Officers Benevolent, defended the officers' actions.

"Judge Royster's comments seem to offer an undeniable bias against law enforcement, including those who were forced to act in defense of their own lives," Carmine Disbrow, president of the Jersey City Police Officers Benevolent Association, said in a statement. "If the officers hadn't responded the way they did at that scene, there is little doubt that this criminal would have succeeded in taking another police officer's life."

The incident occurred yards away from the sidewalk memorial to Campbell, who shot Santiago outside the Walgreens at Communipaw Avenue and Kennedy Boulevard just after 4 a.m. on July 13, 2014.

When officers spotted Highsmith walking with the fence post they ordered him to drop it, but he threw it through the passenger side window of the police vehicle, striking an officer in the head. Highsmith then jumped onto the vehicle's running board, reached for an officer's gun and was shot through the door, officials said.

The officers jumped out of the vehicle and ordered Highsmith to the ground, but he refused and was shot again as he fled, officials said at the time, adding that he ignored orders to show his hands.

It's not clear if Highsmith approached the vehicle or if it backed up beside him, because the CCTV camera was pointed in another direction, Royster said.

"What is clear, is that the reaction of the officer, whatever was occurring, is to shoot the defendant through a door," Royster said. "He was unarmed and recognizably unarmed."

Disbrow took offense with Royster's assessment of the incident.

"To insinuate that this incident was anything more than an attempt to kill a cop is insulting to law enforcement and only invites more bad actors to show contempt for anyone that wears a badge."

Defense attorney Mary Ciancimino said when police arrived at the memorial Highsmith was searched, his hat was knocked off and he was made to watch on his knees among dozens of officers in S.W.A.T gear as the memorial was dismantled. She said this contact between Highsmith and police is not noted in any police report.

Tensions had been running high among police and the community over the creation and eventual dismantling of the Campbell memorial. The attorney defended the memorial by pointing out that Campbell had family members who loved him, no matter how bad the crime.

At the hearing Ciancimino also claimed that officers were spitting on the memorial.

"They told him to go home and he did," the attorney said. "He walked his friend home and was on the way (to his own home). He was scared so he picked up this stupid stick. He's not that guy that walks around with a gun or a knife. He picked up that stupid stick."

She said when three police vehicles drove past him and stopped, an officer already had an assault rifle pointed at him.

Ciancimino said that after Highsmith was shot, an ambulance arrived and left him lying on the ground with multiple gunshot wounds as the police officer was taken away first. During incidents that night, police CCTV cameras were sometimes focused on trees or the sides of buildings rather than on the action, she said.

The judge said there was disrespect on both sides. She also noted that video appears to show officers spitting on Campbell's memorial.

Highsmith, who had never been arrested before, has pleaded guilty to aggravated assault and faces a probationary sentence. Royster said Highsmith committed a crime and "There's nothing right about an individual hurling any kind of object at a police vehicle. To describe it as an assault on both officers is a stretch."

Royster said there is a need to teach officers how to interact with the community and to teach the community how to interact with police. She said she admires the work police do and they make her feel safe. The judge also said that just because there are a few officers who make rash judgments or mistakes, it does not mean that all officers should be criticized.

"The same way that it means that just because you have one African-American male who shot someone who happened to be a police officer who ends up dying, doesn't mean that you should be putting every black male on the corner on their knees, searching them and doing things like spitting on things and disrespecting members of the community."

At the hearing, Royster refused to overturn the state's decision to bar Highsmith from entering the PTI program.

Pretrial intervention provides a route for first-time offenders charged with lesser crimes to undergo a period of supervised release. If the person fulfills their obligations in the program, the charges are wiped from the defendant's record.

It's not clear if any officers involved in the shooting incident were in court. The defendant has yet to be sentenced.