A police officer who spent more than 25 years helping take guns off the streets in Washington, D.C., died Wednesday while accidentally shooting himself attempting to retrieve a gun from a storm drain after police chased a suspect.

Investigator Wayne David of the District’s Metropolitan Police Department died Wednesday, MPD Executive Assistant Chief Jeff Carroll said outside MedStar Washington Hospital Center, where David was treated before succumbing to his injuries.

"It's with a very heavy heart that I announce that Investigator Wayne David, who was assigned to our Violent Crimes Suppression Division, did pass away this evening here at the hospital," Carroll said.

DC POLICE OFFICER SHOT DRIVING TO WORK; 2 PERSONS OF INTEREST DETAINED IN MARYLAND

MPD Executive Assistant Chief Jeff Carroll said outside MedStar Washington Hospital Center that investigator Wayne David died in the line of duty.

MPD Executive Assistant Chief Jeff Carroll said outside MedStar Washington Hospital Center that investigator Wayne David died in the line of duty. (DC Police X)

"Wayne was a true hero to the District of Columbia. Today he gave his life to serve the visitors and the residents here in the District of Columbia, and we will never forget that."

David was trying to recover a firearm that had allegedly been discarded by a suspect during a pursuit along Interstate 295. The gun Wayne tried to retrieve discharged and struck him in the upper body, the MPD said.

CRIME A TOP ISSUE FOR WASHINGTON, DC, DEMOCRATIC PRIMARY FOLLOWING LAST YEAR'S SURGE IN HOMICIDE, CAR JACKINGS

He was rendered aid on the scene by fellow officers before being transported to the hospital, where he was pronounced dead.

MPD Chief Pamela Smith said David "was the epitome of a great officer" who was dedicated and a "highly respected member of the department."

Police siren

Investigator Wayne David of the District’s Metropolitan Police Department died on Wednesday trying to retrieve a firearm that was reportedly left behind by a suspect following a police chase. (iStock)

According to police in a press release, an officer observed a vehicle on Quarles Street and tried to pull the suspect over, to which the suspect jumped out of the vehicle, resulting in a foot chase. 

The suspect jumped from the service road area (Douglass Street NE and the Kenilworth Avenue Service Road) to Interstate-295 southbound. When he jumped down, the suspect dropped the firearm inside a storm drain, police said. 

The suspect, described as a black male with long locks, then fled the area on the back of a motorcycle.

Suspect who allegedly placed gun in storm drain

Person believed to have placed a gun into a storm drain while fleeing from officers.  (Metropolitan Police Department)

David recovered the firearm before accidentally shooting himself. He was transported by helicopter to the local hospital, where he later died.

Police are looking for tips to locate the suspect, and the incident remains under investigation. 

David had been part of the MPD’s Violent Crimes Suppression Unit since 2017, and had helped recover hundreds of guns during that time.

CLICK HERE TO GET THE FOX NEWS APP

Members of the police force began gathering outside the hospital before they received the news that David had died. He was a mentor to many of them and well-liked, according to Fox5DC.

"This is a very tragic loss for our department and our community," Carroll said. "Our hearts go out to his family during this incredibly difficult time."

David leaves behind a daughter, a son, and his girlfriend. Carroll said the death is being considered a line-of-duty death, and that MPD vows to honor his legacy with ceremonies and tributes.