Staff at a Glasgow hospital worked round the clock to restore its computer systems after the network was struck by the Nachi worm.
Essential systems were restored on Friday morning
The problem was detected at Yorkhill Hospital at about 1600 BST on Thursday.
Medical records, which are stored electronically, became unusable, and staff had to switch to using the paper files they normally store in the hospital.
The virus affected about 1,000 network devices, which included computers and printers.
However, a hospital spokesman said all essential hospital systems - such as records, bookings and appointments - had been restored by 0730 BST on Friday.
And he stressed that the problem did not put patients at risk at any time.
The virus only affected computers connected to the network, so did not cause problems with life support machines or other critical care systems.
The spokesman said that the timing of the alert had been "quite fortunate" as it came as clinics were running down for the day.
He praised all the staff who worked to get the problem fixed.
"Our IT department were on it from about 1600 and worked right through the night to get essential systems back by 0730," he said.
The virus tries to fix vulnerable machines
"There were no problems for patient care and we are quite pleased that our policies worked well."
IT staff continued to work during the day to get the non-essential services back up and running.
Yorkhill is home to the Royal Hospital for Sick Children and The Queen Mother's maternity hospital.
Computer experts say the virus does not destroy computer files.
The Nachi or Welchi worm has been described as an "anti-virus virus".
It uses the same trick as last week's disruptive MSBlast virus to travel around the net - but tries to fix vulnerable machines rather than exploit them.
The Nachi worm tries to automatically apply the software patch issued by Microsoft to secure machines against the attentions of MSBlast.
If it finds the MSBlast worm on a PC it removes the malicious program.
However, experts say it can cause problems because it is untested, installs itself automatically, has the potential to cause compatibility problems and create lots of unwanted net traffic.