Machines stopped during operation at Edinburgh Royal Infirmary
A patient was unconscious and under general anaesthetic during the latest power failure at Edinburgh Royal Infirmary, it has been confirmed.
Staff hand-ventilated and monitored the patient's pulse while surgeons completed the procedure by torchlight, over a period of 11 minutes.
Workers for the PFI provider Consort cut the hospital's power supply on 29 March, ahead of scheduled maintenance.
Health Secretary Nicola Sturgeon said Consort had "to get its act together".
It has been revealed the latest power blackout at the hospital last month led to a complete failure of all the electronic equipment in two operating theatres.
Only one operation was actually under way.
NHS Lothian has praised the staff's "fantastic reaction" to the situation.
The problem was caused by maintenance staff from the private company Consort who began planned work too early, while the operating theatres were still in use.
However NHS Lothian said it was the latest in a series of problems which had placed patients in life-threatening situations and it was now planning legal action against the company.
NHS Lothian said it could no longer tolerate the "repeated and potentially life-threatening nature" of such incidents.
Alan Boyter, NHS Lothian's executive director, said: "The patient was hand-ventilated for one-and-a-half minutes in the complete dark and then for a further nine-and-a-half minutes using torches.
"We have reached the point where we can no longer tolerate the repeated, serious and potentially life-threatening nature of these incidents at the Royal Infirmary of Edinburgh by our PFI provider Consort.
"We are currently consulting with our lawyers to discuss what options we have in relation to the contract and it would be inappropriate to comment further while that is ongoing.
"Patient safety is always our absolute priority and we will not allow that to continually be put in danger by a third party."
Ms Sturgeon told BBC Scotland: "These contracts are incredibly restrictive and although the contracts cost the NHS a considerable amount of money, getting out of the contract would cost the NHS much more money.
"Now NHS Lothian has signalled they are going to consult their lawyers and I think they are right to do that.
"I think they now have to look at all options but in the interim this company has to get its act together.
"NHS Lothian, as I am assured it will and I have confidence that it will, must continue to put patient safety first."
Stephen Gordon, a director of Consort, said the power had been disrupted for about 10 minutes on 29 March.
He added: "Consort has taken this incident very seriously and have undertaken a thorough investigation into this matter in conjunction with NHS Lothian to review the current operating procedures in place for works of this nature."