A Philadelphia judge on Tuesday dismissed all charges against a former police officer accused of murder in the shooting death of 27-year-old Eddie Irizarry. 

The municipal judge ruled there was not enough evidence to convict Officer Mark Dial of Irizarry's murder after viewing footage of the fatal shooting. Defense attorneys had argued Dial acted in self-defense when he fired his weapon at close range through the driver's side window of Irizarry's sedan during a traffic stop on Aug. 14.

Dial's lawyer Brian McMonagle had asked Judge Wendy Pew to drop all charges, which included manslaughter, official oppression and four other counts, according to The Associated Press.

"He is firing while trying to take cover," McMonagle said at a hearing Tuedsay, arguing that Dial was afraid for his life. "Every tragedy is not a crime." 

BAIL REVOKED FOR FORMER PHILADELPHIA POLICE OFFICER CHARGED WITH MURDERING EDDIE IRIZARRY

Philadelphia police Officer Mark Dial arrives at court for a hearing with his attorneys

Philadelphia Police Officer Mark Dial, center, arrives at the Juanita Kidd Stout Center for Criminal Justice in Philadelphia, Sept. 19, 2023, with attorneys for a bail hearing. (Alejandro A. Alvarez/The Philadelphia Inquirer via AP, File)

He told the judge the charges should never have been brought against Dial given the evidence. 

"I agree with you 100%," the judge replied.

The decision shocked Irizarry's family members in the courtroom, who told The Associated Press they would urge District Attorney Larry Krasner to appeal.

Earlier this month, prosecutors released bodycam video of the shooting to the public.

A portion of the video shows Dial approaching a stopped vehicle before getting out. A voice is then heard telling the driver, "I will f---ing shoot you."

EDDIE IRIZARRY SHOOTING: FORMER PHILADELPHIA POLICE OFFICER FACES MURDER CHARGE; BODYCAM VIDEO RELEASED

The scene where Eddie Irizarry was shot to death by Officer Mark Dial

Mark Dial faced multiple charges in the wake of the fatal shooting of Eddie Irizarry. (Tom Gralish/The Philadelphia Inquirer via AP)

At least six shots were fired before Dial opens up the shattered driver-side front door and pulls a bloodied Irizarry out into the street and into a police vehicle before racing toward a hospital.

Authorities said Dial shot Irizarry as Irizarry sat in his car after officers spotted the car traveling erratically around noon on Aug. 14 and followed it for several blocks. Officers then approached as the driver turned the wrong way down a one-way street and stopped.

Initial claims stating the officers made a traffic stop and shot a person outside the vehicle after he "lunged at" police with a knife, were backtracked by the department.

PHILADELPHIA POLICE COMMISSIONER RESIGNS AMID CRIME WAVE

Mark Dial turns himself in

Philadelphia police officer Mark Dial enters the 1st Police District, Friday, Sept. 8, in Philadelphia. (Alejandro A. Alvarez/The Philadelphia Inquirer via AP)

Defense lawyers said the shooting was justified. They told the judge that Dial thought Irizarry had a gun. The bodycam footage shows the driver holding a knife by his right leg.

Testimony from Dial's partner, Officer Michael Morris, at Tuesday's preliminary hearing corroborated statements made by authorities. He said the pair had been following Irizarry, who was driving erratically, turned the wrong way down a one-way street and stopped. Morris said Irizarry had a knife in his hand and started to raise it as the officers approached.

"I screamed that he had a knife," said Morris, adding the knife had a black metal handle that could have been mistaken for a gun, The Associated Press reported.

An emotional Dial was seen sitting at the defense table while prosecutors played footage of the fatal shooting captured by Morris' body camera. The prosecution said the videos were "crucial evidence in the case" and said they "speak for themselves." 

CLICK HERE TO GET THE FOX NEWS APP 

Irizarry’s family has said that Dial deserves a long prison sentence.

Dial, 27, is a five-year member of the Philadelphia Police Department. He was suspended with the intent to dismiss after officials said he refused to cooperate with investigators.

Dial had his bail revoked by a judge earlier this month after prosecutors said the charges made him ineligible for release. 

Fox News' Greg Wehner and The Associated Press contributed to this report.