Nija Hill was taken into custody at about 1 a.m. Saturday, according to the Los Angeles Police Department.
LAPD officers responded to a report of an armed robbery near the intersection of East 92nd Street and South Central Avenue at 9 p.m. Friday, officials said.
Police said Hill had pistol-whipped two victims in an alley adjacent to a laundromat, located near the 9200 block of South Central Avenue.
Hill then went inside the laundromat and threatened several other people, according to police. The suspect then went outside where he again threatened several vendors with the firearm, police said.
The laundromat was evacuated and video showed customers running in several directions, some carrying their clothes.
As the officers arrived at the scene, they saw Hill standing on the sidewalk outside of the laundromat and he immediately took off running.
During the foot pursuit, the suspect opened fire, striking both officers, the LAPD said. Police established a perimeter and called a SWAT team.
At that time, Hill apparently tried to carjack someone near 93rd street and Clovis Avenue but was unsuccessful, according to police.
Soon afterward, officers found Hill with a leg injury, hiding inside a vehicle blocks from the scene.
He was sent to a hospital where he was treated for his wound and cleared for booking.
The two officers were released from the hospital Saturday morning after being treated for minor injuries. Another person -- possibly a victim in the robbery -- suffered an injury to the forehead.
Police initially said a second suspect remained at large, but later retracted that statement.
According to police, a Glock Model 17, 9mm, semi-automatic firearm and empty magazine were found in a trash bin near 93rd Street and Clovis Avenue.
Officers also found nine discharged 9mm cartridges near where the officers where shot.
Police said the pistol, magazine, and cartridge casings were processed and booked into evidence.
The incident remains under investigation.
City News Service contributed to this report.