Police will have the power to break up house parties with more than 15 people from Friday in a bid to reduce transmission of Covid-19.
Health officials have warned such gatherings could present “high-risk super-spreader environments”.
First Minister Nicola Sturgeon said the move was necessary in anticipation of a rise in indoor gatherings as winter approached.
And she said taking action now could prevent stricter lockdown measures.
The measures were first announced last week and the new limit was confirmed on Thursday.
Under current guidance, no more than eight people from a maximum of three different households should be meeting indoors.
The new law takes account of the varying size and composition of families and sets the limit for an indoor party at 15 people if more than one household is present.
During her daily media briefing, Ms Sturgeon said: “We know from the reports of our test and protect teams – and also from evidence around the world – that these kinds of gatherings pose a significant transmission risk.”
She acknowledged the colder weather would increase the likelihood of larger indoor social gatherings but said the new legislation was “not a green light” to ignoring the existing guidance.
Ms Sturgeon added: “In recognition that we intend these new legal powers to be a last resort only and for use in the most blatant breaches of the guidance, we have decided to set a higher threshold for their use.
“Ensuing that police have the powers to disperse large house parties, where that is necessary, is another important tool in trying to keep this virus suppressed.”
She added that it would help to reduce the potential for future clusters and outbreaks and prevent greater lockdown restrictions.
‘Proportionate and legitimate’
Addressing young people, Ms Sturgeon stressed that the move was “not about trying to stop people having fun” and added: “We’re not trying to police your social lives.”
But the first minister said the move was necessary for the “overall health and wellbeing of the country”.
Chief Constable Iain Livingstone told the justice sub-committee on policing that he understood the need for a limit to be put into regulation.
Mr Livingstone added: “Where there is outright refusal, where they know the police service is at the door and they’re refusing to let people in and turning the music up and continuing to act in that manner, we do need to go in.
“My position was that given the threat and the gravity of the public health threat that was a proportionate and legitimate power.
“That power has been granted but it is one we will use very lightly, enforcement will be the last resort, but it is there because it is clear from what the FM and others have said is the continuation of house parties remains a real threat.”