The 27-year-old man, who claimed himself to be mentally ill, was captured after stabbing two pedestrians, including a foreign national, to death, state-run Xinhua news agency reported.
The foreigner's nationality has not been revealed yet, police said.
The man stabbed the two pedestrians on Qingnian Road, Chaoyang District.
Police immediately rushed to the scene but the two victims were found dead.
The suspect was captured at the scene.
The man said he was surnamed Xiao and a native of Yishui County, eastern Shandong Province, police said after questioning him.