Albuquerque police released graphic body camera video Thursday from an undercover drug bust that shows a chaotic and emotional scene unfold as lieutenant mistakenly shoots a fellow detective, hitting him eight times and damaging most of his vital organs.

The Jan. 9, 2015 video was made public late Thursday, a day after the city announced a $6.5 million settlement with Jacob Grant, who has had more than a dozen surgeries and faces more medical problems as a result of the shooting. The city agreed to pay the detective’s medical expenses for life.

Albuquerque Police Chief Gorden Eden in a statement described the shooting as a tragedy and said the community and the department were deeply affected.

"As hard as it is to watch and review this video, it is imperative we learn from it," the chief said. "We immediately upgraded undercover officers' training and equipment following this operation and improved supervision, communication and our procedures."

The video shows officers descending upon a car that contained Grant, another undercover officer and two suspects from whom they were going to buy $60 worth of drugs.

Grant's supervisor, now-retired Lt. Greg Brachle, approaches and opens the rear passenger door where Grant is sitting. He yells "gun, gun, gun" and begins shooting. After ducking behind his truck, Brachle remerges and another officer says it was Grant who was shot. Brachle realizes the mistake and begins to yell obscenities and curse at himself.

Brachle asks Grant if he’s OK and Grant says no. He ten helps Grant out of the car and lays him down on the pavement in the parking lot of the fast food restaurant where the sting occurred.

In distress, Brachle repeatedly screams Grant's name as other officers call for paramedics.

"Jacob, man, hang in there bro. I thought you were a bad guy," Brachle said before running back to his truck and grabbing a medical kit.

Brachle retired before a police oversight board recommended that he should be fired. Brachle also missed a pre-operation briefing the morning of the bust.

Brachle's lapel camera shows him driving to the scene. On the police radio, detectives are heard describing what the two suspects are wearing and where they are sitting in the car.

The video also shows the chaos that ensues following the shooting. Brachle and other officers are using special seals to treat Grant's gunshot wounds before he's taken by ambulance to University of New Mexico Hospital.

The district attorney's office is still reviewing the video and other evidence to determine if Brachle will face any charges.

Eden said Wednesday the department has made several policy changes and has focused on changing how they approach undercover operations, the Albuquerque Journal reported.

The shooting came just days after another Albuquerque police officer was shot and wounded by a suspect during a traffic stop and as the city and the U.S. Justice Department worked to finalize an agreement to overhaul the police department following a harsh report on its use of force.

The newspaper reported there are about 30 police shooting incidents by Albuquerque police officers, Bernalillo County Sheriff’s Office deputies and deputy U.S. marshals in which the district’s attorney hasn’t decided whether the officers will face charges. Some of them date back to 2013.

The Associated Press contributed to this report.