Britain's National Health Service says hospitals across the country have been hit by a "ransomware" cyberattack but there is no evidence that patient data has been accessed.

NHS Digital, which oversees hospital cybersecurity, says the attack used the Wanna Decryptor variant of malware, which holds affected computers hostage while the attackers demand a ransom. The investigation is still in early stages, according to NHS.

NHS Digital says the attack "was not specifically targeted at the NHS and is affecting organizations from across a range of sectors."

The attack is causing canceled procedures and appointments at hospitals across England. NHS Digital says 16 NHS organizations report being hit.

Hospitals in London, northwest England and other parts of the country reported problems with their computer systems Friday. They asked patients not to come to the hospitals unless it was an emergency.

â–ºMake it easy to keep up to date with more stories like this. Download the WFMY News 2 App now.

Pictures posted on social media showed screens of NHS computers with images demanding payment of $300 worth of the online currency Bitcoin, saying: "Ooops, your files have been encrypted!"

At work at the moment in the #nhscyberattack all patients have been sent home and our systems are on lockdown

— Thomas Coffey (@ThomasOCoffey) May 12, 2017

NHS Merseyside, which operates several hospitals in northwest England, tweeted that "following a suspected national cyberattack, we are taking all precautionary measures possible to protect our local NHS systems and services."

Bart's Health, which runs several London hospitals, said it had activated its major incident plan, cancelling routine appointments and diverting ambulances to neighboring hospitals.

Friday's ransomware cyberattack may extend beyond the U.K.: in the late afternoon, the Spanish government said several companies in Spain have also been targeted in ransomware cyberattacks.

The Industry Ministry says the attack affected the Windows operating system of employees' computers, blocking files and demanding a ransom to free up the system.

It said the attacks had not affected the companies' services or data protection of their clients. Microsoft issued a security update on March 14 about vulnerabilities in the Windows system. There were no details on which companies were targeted or the origin of the attack.

U.S. hospitals have fallen victim to ransomware attacks in the past. In one highly publicized case last year, Hollywood Presbyterian Medical Center paid hackers the equivalent of $17,000 in bitcoins to regain access to its computer network.