Hospital bosses have closed wards to new patients and restricted visitors after an outbreak of the norovirus affecting a third of patients.
Relatives and friends of people receiving treatment at Liberton Hospital are being advised not to visit in a bid to halt the spread of the vomiting bug.
NHS Lothian said 51 out of 151 patients have been confirmed as having norovirus since the start of the outbreak on January 29, plus 17 staff members.
Eight of the nine wards at the hospital are closed to new patients.
Ingolfur Johannessen, consultant medical virologist at NHS Lothian, said: "A large number of patients at Liberton Hospital are affected by norovirus with a significant number testing positive for the virus.
"We have taken the decision to temporarily restrict visitors in a bid to prevent the further spread of the infection and to ensure the hospital returns to normal working as soon as possible.
"By restricting the number of visitors it is hoped that this will reduce the number of people who are exposed to norovirus and therefore shorten the duration of the outbreak."
Alison McCallum, the health board's director of public health, added: "While we understand that this temporary visiting restriction may cause some frustration, this measure will allow us to help prevent further spread of the infection and ensure safe patient care.
"We understand that there may be extenuating circumstances where members of the public need to visit loved ones, such as if they are seriously ill. If this is the case, relatives or friends are asked to call ahead to the ward to arrange visiting."
Norovirus is highly contagious and outbreaks spread quickly in places like hospitals and nursing homes. The symptoms include vomiting, diarrhoea and nausea.