LAPD said the shooting occurred near Hollywood Boulevard and Highland Avenue around 11 a.m.
A 19-year-old woman who had been stabbed approached officers and directed them to the suspect, a man in his 30s, police said.
Police approached the suspect, who they say was armed with a knife.
"Officers gave the suspect commands to drop the knife, which he ignored," police tweeted. "The suspect advance towards the officers, several beanbag rounds were deployed and officer involved shooting occurred."
The suspect was struck and transported to a hospital to be treated for injuries described as not life-threatening, police said.
Witnesses said they heard six to seven shots.
"The first thing I noticed was the cop cars pulling in very quickly to that corner," said Frank Dickerson, a tourist from Phoenix who captured the shooting on video. "They got out, had weapons drawn and then it was all real quick, like within a matter of a minute ... the shots were fired."
According to investigators, the attack was random. Extra officers who were on patrol due to increased crime in the area responded quickly.
"It's a random attack. Unfortunately, it happened, but thankfully the officers were there to address that problem immediately," LAPD Sgt. Bruce Borihahn said.
LAPD said the suspect's knife was recovered at the scene.
The victim, who was stabbed in the abdomen, was taken to a hospital in stable condition.
The department also tweeted that the intersection of Highland and Hollywood would be closed temporarily for the investigation and traffic was being diverted to Sunset Boulevard to the south and Franklin Avenue to the north.
Police are reviewing video from the officers' body cameras and numerous surveillance cameras in the area.
City News Service contributed to this report.