Service to most NHS hospitals has been restored following an unprecedented hacking attack, Home Secretary Amber Rudd has confirmed.

She said that 48 of 248 NHS trusts were compromised in the attack which affected over 100 countries, but now service has been restored to all hospitals except six.

The announcement was made following a Cobra meeting in Whitehall.

It comes as doctors in affected hospitals could not access X-ray scans or patient monitoring systems operated using the computer network.

The accusation came after it emerged that up to 90% of NHS trusts still use Microsoft XP despite the operating system being 16 years old and no longer supported by Microsoft.

"I am extremely concerned that extensive warning signs appear to have been ignored by yourself and your department," Labour's Shadow Health Secretary Jonathan Ashworth said in a public letter to Hunt.

"Yesterday's attack is unprecedented in scale, but it is abundantly clear that our NHS should have been better prepared for ransomware attacks.

"Therefore, will you firstly explain why NHS organisations failed to act on a critical note from Microsoft [explaining the risks to the NHS] two months ago?"

NHS Doctor Surgeon
48 of 248 NHS trusts were compromised in the attack Christopher Furlong/Getty Images

However, Rudd has dismissed claims that NHS systems were left vulnerable.

"If you look at who's been impacted by this virus, it's a huge variety across different industries and across international governments," she said, reported the Guardian.

"This is a virus that attacked Windows platforms. The fact is the NHS has fallen victim to this.

"I don't think it's to do with that preparedness. There's always more we can all do to make sure we're secure against viruses, but I think there have already been good preparations in place by the NHS to make sure they were ready for this sort of attack."