GARFIELD, N.J. (CBSNewYork) – A New Jersey man accused of shooting a suspected burglar appeared in court Friday.

Omar Smadiya, 37, was charged Thursday with attempted murder, unlawful possession of a weapon and possession of a high-capacity magazine. In court Friday he was released from jail and ordered to surrender his passport and firearms.

His defense attorney was outraged during the proceedings.

“Dismiss these charges,” attorney Frank Lucianna said. “He shouldn’t be charged, he did what anybody would’ve done.”

Omar Smadiya (Credit: Bergen County Prosecutor’s Office)

Police said Smadiya confronted 19-year-old Christopher Manon-Velez outside his vehicle early Tuesday morning and shot Manon-Velez in the back.

He was found at a nearby fast-food restaurant and taken to an area hospital, where he is listed in stable condition.

Christopher Manon-Velez (Credit: Bergen County Prosecutor’s Office)

Police said Manon-Velez had already broken into several vehicles in the neighborhood, and himself is facing burglary charges.

“There’s a man rummaging through his car, damaging throwing things out,” Lucianna said. “He had a gun, he had the right to use it.”

Prosecutors say Smadiya shot Manon-Velez in the back as he was running away, his lawyers claim it was from the front and stressed he has no prior record.

His gun was also purchased legally, according to his lawyers.

Neighbors tell CBS2 Smadiya has lived on the same block for years, and say he has a wife and toddler. He’s due back in court next month, where lawyers say he plans on pleading not guilty.