Eight staff at Ayr Hospital were given medical treatment after a chemical spill near an intensive care ward.
Patients on the ward were evacuated to a safe area following the incident on Tuesday at about 1845 BST.
Firefighters wearing chemical protection suits and breathing apparatus sealed an ammonia leak from a refrigeration unit.
The staff were treated after complaining of minor breathing difficulties and headaches.
Firefighters from Kilmarnock and Maybole were assisted by Strathclyde Fire and Rescue's technical support unit in the incident at the hospital in Dalmellington Road.
The refrigeration unit was removed from the premises and the ward was fully ventilated.