SAN FRANCISCO (CBS SF/AP) — Prosecutors in San Francisco have dropped charges against a man who his attorney says was falsely accused of attacking a police officer while being arrested early last year, but ended up hospitalized himself with injuries sustained during the arrest.

Sergio Lugo was hospitalized with a fractured cheekbone and other injuries after his arrest on Feb. 17, 2021. He was falsely accused of assaulting a San Francisco police officer who along with two other officers illegally detained him in February 2021 after beating him up, the public defender’s office said Wednesday.

READ MORE: Oakland Police Arrest Homicide Suspect Who Fatally Shot Male Victim, Fired at Firefighters

Lugo’s attorney said she has filed a complaint with the Department of Police Accountability on his behalf.

Two officers, who had been surveilling a neighborhood for burglars, detained and questioned Lugo but when they told him they wanted to search him, Lugo told them that he intended to walk away, the public defender’s office said.

This Feb. 2021, image released by the San Francisco District Attorney’s Office shows Sergio Lugo recovering in the hospital with bruises, lacerations, and a fractured cheekbone after an encounter with San Francisco police officers. Lugo was falsely accused of assaulting a San Francisco police officer who along with two other officers illegally detained him in Feb. 2021 after beating him up, the public defender’s office said Wednesday, Jan. 12, 2022. (San Francisco District Attorney via AP)

“Without any verbal warning, the two officers grabbed his arm, kicked his legs out from under him, and pinned him on the ground,” the office said.

A third officer who joined in later admitted to hitting Lugo between 15 and 25 times, the public defender’s office said.

After Lugo’s arrest, the San Francisco Police Department released a statement saying two officers had been injured when trying to detain Lugo, who became combative and produced a razor blade.

The department said Lugo had attacked the officers, stabbing an officer in his left hand and left knee and that the other officer had been injured in his hand during the struggle.

READ MORE: San Francisco Police Arrest Man Suspected of Carjacking Uber Driver in SoMa

Lugo was booked into San Francisco County Jail on charges of assaulting a police officer, resisting arrest, possession of methamphetamine and possession of burglary tools.

The public defender’s office said that when police first encountered Lugo, he was holding a silver object in his hand, which police thought was a vape pen.

“All parties agree that when police pinned Mr. Lugo, the cap fell off, revealing that it was an X-acto Knife — a small pen-shaped tool with a sharp edge often used in crafts. The sharp edge caused superficial cuts to one officer’s pinkie and knee, but the officers’ blows to Mr. Lugo’s head sent him to the hospital with bruises, lacerations, and a fractured cheekbone,” the office said.

Lugo was later charged with assault on an officer, exhibiting a deadly weapon to resist arrest, and three counts of resisting arrest using force. He spent over four months in jail.

This week, as the case was getting ready to go to trial, the defense argued that Lugo had committed no crime and the prosecutor agreed Tuesday to dismiss the case, the public defender’s office said.

“We carefully reviewed all the evidence in this case, including statements, surveillance, the fact that police officers were not wearing body worn cameras, inconsistencies in police officer statements, the fact that Mr. Lugo was behaving lawfully when stopped by police, and the photos of the injuries of all parties—which depicted severe injuries to Mr. Lugo, whom police badly beat during this encounter—and it was clear that this was not a provable case,” said Rachel Marshall, spokeswoman for San Francisco District Attorney’s Office.

San Francisco Chief of Police Bill Scott later released a statement expressing his dismay over the move by prosecutors.

“I’m disappointed with the District Attorney’s decision in this case,” Scott said. “Mr. Lugo resisted arrest and violently assaulted our officers, injuring one of them with an X-Acto Knife. These kinds of attacks are unacceptable and shouldn’t be tolerated by our criminal justice system. When they are, it sends a dangerous message that emboldens criminals to use violence — and not just against police officers.”

MORE NEWS: 49ers Playoffs: Faithful Gear Up As Showdown Vs. Packers Nears

© Copyright 2022 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.