The apparent cyberattack quickly spread to other nations. Kaspersky Lab said it had detected more than 45,000 attacks of the WannaCrypt software in 74 countries, mostly in Russia. US-based delivery giant FedEx and Spain's telecommunications company Telefonica reported their systems were affected as well.
The software locks a computer and prompts the user to pay a $300 "ransom" in the digital currency Bitcoin to decrypt their files.
WannaCrypt was included among purported US National Security Agency (NSA) hacking tools leaked in April by a group calling itself Shadow Brokers.
"Today our engineers added detection and protection against new malicious software known as Ransom: Win32.WannaCrypt," the statement said.
Microsoft noted that it first patched the vulnerability in a security update in March and Windows users who updated their computers and used the company’s free antivirus program were protected from the malware.
Many of the NHS computers affected by the ransomware on Friday were not updated, according to media reports.