WEST MIAMI (CBSMiami) — A Miami-Dade police detective is recovering Wednesday after being shot in the ear while on duty.

The officer was rushed to Jackson Memorial Hospital’s Ryder Trauma Center where he was treated and released.

The shooting took place Tuesday night, while detectives were conducting a narcotics investigation at an apartment complex at 2001 SW 67th Avenue in West Miami.

Chief Colina: Actions Of Uniformed Miami Officer With Pro-Trump Mask At Voting Site ‘Unacceptable’
Miami Beach Postal Employee Admits To ‘Stealing Mail Sporadically’ For The Past 2 Years
Veteran Teacher Speaks Out As COVID-19 Cases Jump To 90 At Miami-Dade County Public Schools

“As detectives were in front of the door of the apartment, they were confronted with gunfire,” said Det. Alvaro Zabaleta, spokesperson for the Miami-Dade Police Department.

The department’s Special Response Team and hostage negotiators responded when the shooter barricaded himself inside.

Police evacuated everyone on the floor where the incident occurred, but there were still plenty of people inside of the building.

“I went down the elevator and it could have been any of them. I am just still so shocked,” said Maria De Monte, who lives in the apartment complex.

After several hours, the shooter surrendered and was arrested around 11 p.m. He was taken to the hospital for an apparent gunshot wound.

Three other people were also arrested as part of the narcotics investigation.

Police have not released their names or their charges.

The officer, meanwhile, is doing well.