It comes after Wales became the first country in Europe to introduce a safe staffing law for nursing in 2016.
However, the Health and Care (Staffing) (Scotland) Bill goes further as it applies to all clinical staff groups and also includes social care.
The bill strives to ensure providers in both sectors have the “appropriate” workforce in place to deliver “safe and high-quality care”.
It aims to support both workload and workforce planning and introduces reporting requirements to ensure staffing decisions are open and transparent.
“This is an important bill that will promote safe staffing”
The ground-breaking bill was passed unanimously following a cross-party debate in Scottish parliament this afternoon with 113 votes in support and none against.
Health secretary Jeane Freeman told the debate that the bill made Scotland “world leading” in its approach to healthcare staffing.
Speaking after the vote, Ms Freeman said: “This is an important bill that will promote safe staffing across our NHS and social care services and, in doing so, improve patient experience.
“It will ensure that the right people with the right skills are in the right place at the right time,” she added.
Scotland’s first minister Nicola Sturgeon made the commitment to put safe staffing on a statutory footing at the Royal College of Nursing’s congress in 2016.
Since then, the RCN said it had been working alongside politicians to help shape the legislation.
“What’s needed is a change in our wider safety culture”
Reacting to the news, Theresa Fyffe, director of RCN Scotland, welcomed the move and said it was clear that members had been listened to.
“With this legislation the Scottish government has set expectations on standards of care and who is accountable for maintaining safe staffing,” she said.
“Over the coming months we will continue our work, supporting the development of guidance and the plan for implementation,” Ms Fyffe said.
However, she added that legislation alone would not solved the nursing staff challenges facing Scotland.
”What’s needed is a change in our wider safety culture and a fully funded, long-term workforce planning process that ensures Scotland has the right number of nursing staff to meet future needs,” said Ms Fyffe.
Source: Andrew Cowan/Scottish Parliament
Her comments were mirrored by leading politicians in the debate.
Monica Lennon, Scottish Labour shadow health secretary, warned that the bill could not be seen as a “panacea”.
Her Scottish Conservative and Unionist equivalent, Mike Briggs, added that without action to address staff shortages the ambitions of the bill would be a dream not a reality.
The RCN is also campaigning for safe staffing legislation in England and Northern Ireland.