Putin, who is currently in Beijing for the two-day Belt and Road Forum, said intelligence services should beware of creating software that can later be used for malicious means, Daily Mail reported.
"As regards the source of these threats, I believe that the leadership of Microsoft have announced this plainly, that the initial source of the virus is the intelligence services of the US," Putin said.
"Once they are let out of the lamp, genies of this kind, especially those created by intelligence services, can later do damage to their authors and creators," he told reporters in Beijing.
Putin claimed there was no significant damage to Russian institutions, including its banking and healthcare systems, from the computer worm. "But as a whole it is worrying, there's nothing good about it, it is a source of concern."
He added that global leaders needed to discuss cyber security at a "serious political level" and said the US has backed away from signing a cyber security agreement with Russia.
The initial attack, known as WannaCry, paralysed British National Health Services (NHS) computers, Germany's national railway and scores of other companies and government agencies around the world.