"A police officer has been stabbed in the back and the neck," inspector Ronnie Tellberger told AFP, saying the assailant had attacked him from behind.
The motive for the attack was not immediately clear.
Sweden has been on edge since April when an Uzbek asylum seeker deliberately ploughed a truck into shoppers in central Stockholm, killing five people including an 11-year-old girl.
The incident occurred around 10:30 am (0830 GMT) near a subway exit in Medborgarplatsen Square in the Sodermalm neighbourhood.
More From This Section
The police officer was taken to hospital, but his life was not in danger, it said.
A witness told AFP he saw police arrest a man at the scene.
"It happened so quickly, there was barely time to notice anything," he said.