MSPs have passed a motion warning that patient safety is at risk amid a "recruitment crisis" in the NHS.
Holyrood backed a series of opposition amendments following a Scottish government debate on patient safety.
They included a Lib Dem mention of a "recruitment crisis" and Labour warnings that services are "near breaking point".
This left the SNP voting against Shona Robison's amended motion, but they were defeated by opposition members.
Health Secretary Ms Robison had put forward a motion highlighting the work of the government's "world-leading" patient safety programme.
It said the programme "represents the international benchmark for safe care" and noted "the huge challenges that face the NHS in meeting the demands of an ageing population and those of integrating health and social care services".
Members unanimously backed a Conservative amendment from Donald Cameron adding that the health service is "facing severe workforce and staffing issues", and that "further action on staffing must be a priority".
Another amendment from Labour's Anas Sarwar was then passed by 62 votes to 61, adding in claims that "services are facing a situation in which demand is often outstripping supply". It also cited a report from the British Medical Association that the NHS is "near breaking point".
A further amendment from Lib Dem Alex Cole-Hamilton highlighted a "recruitment crisis" in the NHS, raising fears it could "pose a risk to patient safety", and was passed by the same margin.
The amended motion was then passed by 62 votes to 61, with SNP members voting against.