MSPs have passed the Scottish Executive's flagship Anti-social Behaviour Bill.
Ministers say they are determined to "clean up" problem areas
The new measures were approved by 103 votes to 11.
Ministers described the new law, which includes controversial powers to break up gangs, as a defining moment for the Scottish Parliament.
The legislation also covers the introduction of parenting orders, electronic tagging of under 16s and a ban on selling spray paint to youths.
During the debate at Holyrood, new police powers to move on gangs in trouble hotspots were backed by MSPs.
A motion to throw out the dispersal proposal was defeated by 63 votes to 34 with 20 abstentions.
Communities Minister Margaret Curran told MSPs that the bill "stands up for the ordinary decent hard-working people of Scotland".
Ms Curran said: "We owe it to those communities who have been pleading for these powers even in the light of scorn from those who think otherwise, to give them the respite it will afford."
She added: "This bill gets the law right on anti-social behaviour. It plugs existing gaps and gives valuable new tools for those engaged in the fight to put our communities first."
However, the executive did agree to a study into the use of the dispersal powers within three years of them coming into force.
Tory Glasgow list MSP Bill Aitken, who lodged the amendment to scrap dispersal, said the executive was wrong to pursue the idea.
Mr Aitken insisted that existing powers of breach of the peace and other laws were adequate to deal with disorder but that beat police numbers were not sufficient to do so.
He described the new powers as "unprecedented in Scotland" claiming they could see people moved on from designated areas without having committed an offence, in a manner "reminiscent of the South African pass laws".
He said: "Scots law has always and rightly proceeded on the presumption of innocence. The minister is asking us to proceed on the assumption of guilt."
Labour Glasgow Pollok MSP Johann Lamont insisted that innocent youngsters had nothing to fear, saying many of them suffered from the effects of anti-social behaviour.
She said criticisms of dispersal had been "overblown, overstated and unhelpful", and insisted that the current law was insufficient to deal with group disorder.
ANTI-SOCIAL BEHAVIOUR (SCOTLAND) BILL
New police powers to move on groups of
more than two people in designated trouble spots
Extending anti-social behaviour orders to the 12-15 age group
Banning the sale of spray paint to under 16s
Fixed penalty notices for offences including litter, urinating in the street, drunken behaviour, vandalism, or consuming alcohol in a public place
Extending electronic tagging to children, through the courts and the hearing system
Parenting orders, under which parents can be required to do more to control their children
Tougher powers for councils to deal with private landlords who turn a blind eye to anti-social tenants
Police powers to close premises where drug dealing or other
anti-social behaviour takes place
But Liberal Democrat backbencher Mike Rumbles, who along with party colleague Keith Raffan backed the Tory amendment warned that the "illiberal" plans would exacerbate relations between youngsters and police.
Mr Rumbles told MSPs that by creating the new dispersal power they would "drive a coach and horses through the evidence-based approach to legislation which you are supposed to have adopted here".
He said: "Many people are specifically concerned that our hard-won rights to peaceful assembly are under threat and I have heard no valid reason why we should support this draconian measure."
Green justice spokesman Patrick Harvie warned ministers: "The executive has heavily oversold this entire bill and specifically the dispersal measure as a solution to people's genuine problems."
Scottish Socialist justice spokesman Colin Fox warned that innocent youngsters would get "caught up in the dragnet" and have their rights to assembly breached.
SNP justice spokeswoman Nicola Sturgeon, whose party abstained on the key vote, said she accepted there was some evidence that communities wanted the new powers and "it would be wrong to deny the executive the opportunity to put them to the test".
But she predicted that the powers "promise much more than they can ever deliver" and warned: "If the executive is wrong on this they will be held to account."
However, Ms Curran rejected the "complacency and defeatism" of her opponents, insisting that MSPs who backed the new powers were "on the side of victims of anti-social behaviour".
Meanwhile, the National Autistic Society Scotland said it welcomed the legislation "in principle" but expressed concern about possible unintended repercussions for people with disabilities.
National co-ordinator Robert McKay said: "As it stands, a person with a disability could display a strange behaviour which does not harm anybody and this could be interpreted as 'likely to cause' distress.
"This needs to change so that people with all types of disability are protected from discrimination."
Scotland's new Commissioner for Children and Young People, Kathleen Marshall, repeated her fears over the dispersal powers.
Dr Marshall said: "Children and young people have a right to engage in social behaviour, and it is natural and right for them to want to associate with their friends."
The bill, which will be backed by £60m executive funding, also introduces a new national private sector licensing scheme, giving councils sweeping new powers to ban rogue landlords from renting flats.
The legislation will come into effect towards the end of the year.