Scotland has become the first country in the UK to make it a criminal offence for parents to smack their children.
The ban on all physical punishment was backed overwhelmingly by 84 votes to 29 by the Scottish Parliament on Thursday afternoon.
The move will give children in Scotland the same protection from assault as adults when it comes into force.
Parents and carers are currently allowed to use "reasonable" physical force to discipline their children.
The smacking ban bill was introduced by Scottish Greens MSP John Finnie, a former police officer, who won the support of the SNP, Labour and Lib Dems as well as his own party and many children's charities.
Mr Finnie said smacking teaches children that "might is right", and that the ban would "send a strong message that violence is never acceptable in any setting".
He also said there was "irrefutable" evidence that physical punishment damages children, is not an effective form of discipline and can escalate into physical abuse.
The ban was opposed by the Scottish Conservatives, who claimed the bill was bad legislation that risks criminalising "good parents" for using "reasonable chastisement".
But the Scottish government's children's minister, Maree Todd, insisted that "loving parents" would not be criminalised.
Sweden became the first country in the world to ban smacking in the home when it outlawed corporal punishment in 1979 - with Scotland becoming the 58th to do so.
Wales is also on the verge of introducing a ban - but there are not currently any plans for England or Northern Ireland to follow suit.
What physical punishment are parents currently allowed to use?
In Scots Law, all physical attacks on adults can be treated as assault - but children do not have the same protection.
This is because a person accused of assaulting of a child can claim a defence of "reasonable chastisement" or "justifiable assault" when they have used physical force as a form of discipline on children under the age of 16.
When deciding whether the chastisement was reasonable, the courts take into account factors such as the nature of the punishment, its duration and frequency, the age of the child and the effect - both physical and mental - it had on them.
In practice, this generally means parents are allowed to smack their children on the body - but blows to the head, shaking or the use of an implement are illegal.
All physical punishment in schools and other education settings is already completely banned.
How will this change?
Opinion polls have suggested a majority of people in Scotland are opposed to a smacking ban - with critics arguing that the current law is sufficient, and that the changes risk criminalising "good" parents.
But most of the responses to a consultation on Mr Finnie's bill were in favour of a ban, and the move has been widely supported by children's charities.
The bill will end the defence of reasonable chastisement, meaning parents could face prosecution for any use of physical punishment on their children.
This will give children the exact same protection from assault as adults.
The bill uses the same definition of physical punishment, sometimes referred to as corporal punishment, used by the UN Committee on the Rights of the Child.
It includes hitting such as smacking, slapping and smacking with a hand or an implement, as well as kicking, shaking or throwing children, scratching, pinching, biting, pulling hair or boxing ears, forcing children to stay in uncomfortable positions, burning, scalding or forced ingestion.
How widespread is smacking anyway?
A report published by a group of Scottish children's charities in 2015 found that the physical punishment of children was more common in the UK than in similar countries such as the US, Canada, Italy, Germany and Sweden.
The researchers estimated that between 70% and 80% of parents in the UK have used physical punishment, with children aged between three and seven the most likely to be smacked.
They also found that many parents do not view smacking as a "good thing", but believe that sometimes it is the "only thing that will work".
And they said the use of physical chastisement has declined over the years alongside a shift in public attitudes, with "convincing evidence" that the decline has been steeper in the more than 50 countries around the world that have already banned smacking.
Research examining the views of children on smacking has suggested that it hurts and upsets them, and does not always stop bad behaviour.
What do opponents of the ban say?
A campaign against the ban has been led by the Be Reasonable Scotland group, which argues that the move - while well-intentioned - could do more harm than good.
The group argues that the current law only allows parents to use "very mild discipline" such as a smack on the hand or bottom - which would become a criminal offence in the future.
They say that the "unnecessary" changes will therefore do nothing more to help vulnerable children who are the victims of serious physical abuse, but will cause traumatic interventions in "good" families.
And they have urged the government to instead invest in social work and other services to improve their ability to identify and tackle genuine abuse.
What is the law elsewhere?
Parents in England and Wales can currently face criminal charges if they hit a child so hard that it leaves a mark, or causes bruising, swelling, cuts, grazes or scratches.
However Wales is close to an outright ban, with a bill currently working its way through the Welsh assembly that would remove the defence of "reasonable punishment" that has been in force since Victorian times in England and Wales.
There have been calls for England to follow suit, with the Association of Educational Psychologists saying last year that smacking is harmful to children's mental health and should be banned.
Northern Ireland has similar legal provisions to those in England and Wales, while Ireland banned smacking in 2015.