A D.C. police officer was stabbed in the neck, shoulder and back early Thursday while responding to a call near Franklin Square in downtown Washington, and a homeless man intervened to help, according to the police chief.

The officer was being treated at a hospital. Police said the injuries did not appear to be life-threatening.

Police said the officer responded to a report of a man beating a woman about 6 a.m. The officer got a description of the attacker and saw a person matching that description walking away, police said.

The officer followed him for several blocks, in his cruiser and on foot, until they reached 13th Street and New York Avenue in Northwest Washington.

D.C. Police Chief Peter Newsham said at that corner, the man “turned around with a pair of scissors and stabbed the officer.”

Newsham said a bystander, who police described as homeless, intervened “and probably saved our police officer’s life.” He said other officers arrived and arrested the assailant.

Police identified the suspect as Robert Redding, 61, who has no fixed address. Newsham said Redding was charged with assault with intent to kill a police officer.

Newsham said the officer who was injured had repeatedly demanded the man stop, and that the man refused. The chief described the attack as “unprovoked.” The officer, a 19-year veteran assigned to the 2nd District, was treated at a hospital for serious injuries.

Some media reports said the homeless man had previously interacted with the officer and knew him.

“I do say that it does make me feel good to see that a guy who our police developed a relationship with was willing to put himself in jeopardy to protect one of our officers,” Newsham said. “That is something we won’t forget. That was very kind and very heroic.”

Police did not identify the man who helped, but News Channel 4 found him on 13th Street and identified him as John Burrows.

Burrows told the television station that he grabbed the attacker’s arm and “me and the cop together got him under control so he couldn’t stab him no more.”