(Adds PM May spokesman latest details)
By Costas Pitas and Alistair Smout
LONDON, May 12 (Reuters) - Hospitals and doctors' surgeries across Britain were forced to divert ambulances, turn away patients and cancel appointments on Friday after a 'ransomware' cyber attack crippled some computer systems in the state-run health service.
The National Health Service (NHS) said dozens of organisations had been affected by the cyber attack which was causing major disruption to IT systems.
The attack appeared to be part of a wider international hack and the NHS said it did not believe it had been specifically targeted; Spain's government said a large number of companies, including telecommunications giant Telefonica, had also suffered a ransomware attack..
"The investigation is at an early stage but we believe the malware variant is Wanna Decryptor," NHS Digital, the computer arm of the English health service, said in a statement.
"This attack was not specifically targeted at the NHS and is affecting organisations from across a range of sectors."
Prime Minister Theresa May, who was out campaigning ahead of next month's national election, was being kept informed while Health Secretary Jeremy Hunt was being briefed by security experts, a spokesman for May said.
No patient data was believed to have been accessed during ransomware attack but it was unclear what its impact had been on emergency cases.
Britain's National Cyber Security Centre (NCSC), part of the GCHQ spy agency, and the National Crime Agency said they were investigating.
At least 21 hospitals as well as doctors' practices across England and Scotland reported the cyber attack was causing huge problems to their services with the public in areas affected advised to only seek medical care for emergencies.
Professor Helen Stokes-Lampard, chair of the Royal College of General Practitioners which represents family doctors, described the attack as "scandalous and extremely worrying".
"We are still unclear about the overall impact on GP practices and afternoon surgeries, although we know many systems are being switched off," she said in a statement.
"This could mean that urgent messages about patient care are failing to get through at present and that important information is currently being delayed – this is inexcusable."
Hospitals reported phone systems, X-ray services and patient administration systems had been affected while one doctor in eastern England reported all cancer treatments had been suspended in his area.
The Barts Health group, which manages major central London hospitals including The Royal London and St Bartholomew's, said it had activated a major incident plan and there were delays.
"Ambulances are being diverted to neighbouring hospitals," it said.
The opposition Labour Party said the attack showed the need to place cyber security at the heart of government policy. "This cyber-attack is terrible news and a real worry for patients," Labour's health spokesman Jonathan Ashworth said. (Additional reporting by Kate Holton, Andy Bruce, Michael Holden, David Milliken, Emily G Roe and Elisabeth O'Leary; Writing by Guy Faulconbridge and Michael Holden; Editing by Ralph Boulton)