A norovirus outbreak has struck the Borders General Hospital near Melrose.
NHS Borders said there were confirmed cases in ward 4 while patients on ward 12 were also experiencing "gastrointestinal symptoms".
It asked anyone who had suffered symptoms in the last 48 hours to stay away from the hospital.
Visitors to the affected wards were also being "strongly discouraged" as efforts continued to try to stop the infection spreading.
Joint Director of Public Health Dr Tim Patterson said: "Norovirus is one of the most common causes of diarrhoea and vomiting illness.
"It is very infectious and spreads quickly between people.
"This is why outbreaks happen in hospitals where a number of people are sharing facilities.
"However it doesn't just occur in hospitals, and can start abruptly and spread quickly through communities."
He added that patients, visitors and staff all had a part to play in helping to minimise the impact of the outbreak.