Davon Easton was taken into custody by the U.S. Marshals and charged with assault with intent to kill while armed, possession of a firearm during a crime of violence, assaulting a law enforcement officer, and unlawful possession of a firearm.
The officer who was struck is "home and recovering well from his injuries," DC Police Chief Robert Contee said Tuesday.
Around 9 p.m. on Sunday, officers observed a man who "appeared to be very suspicious" and tried to make contact with him, according to Contee.
"As the officers were getting out of the car, the suspect fired multiple shots in the direction of MPD officers," Contee said.
One officer was struck in the hand and the bullet ricocheted off his head, FOX 5 DC reports.
Law enforcement barricaded the area for several hours, but the suspect got away. Members of the U.S. Marshals' Capital Area Regional Fugitive Force arrested Easton on Tuesday.
A firearm with an extended magazine was recovered inside a nearby residence on the night of the shooting.
"This is a very real example of the dangers our officers face when they are serving and protecting in Washington, D.C.," Contee said.