MSPs have passed a bill making it illegal to bar women from breastfeeding their babies in public.
The bill is designed to protect mothers wishing to breastfeed
They voted by 103-13 to make it an offence to stop anyone feeding milk to children under two in public or in family-friendly licensed premises.
The Breastfeeding (Scotland) Bill received wide support and was passed on Thursday afternoon.
Anyone breaking the law and preventing a mother from breastfeeding will be liable to a fine of up to £2,000.
Do you agree with the law on breast-feeding in public?
Results are indicative and may not reflect public opinion
Vote now closed
Conservative politicians voted against the legislation and were in favour of a voluntary code of practice, branding the move an example of "the nanny state taken to the extreme".
The members bill was put forward by Labour MSP for Coatbridge and Chryston Elaine Smith.
She told the BBC's Good Morning Scotland programme: "It's important to increase the rates of breastfeeding in Scotland for the health of our children.
"Voluntary codes have been tried for many, many years and sometimes you find when voluntary codes are in place, the mystery breastfeeders go out and they still experience problems.
"I think this bill will send a strong political message which says that breastfeeding isn't something shameful but it's something that should be protected and supported as normal nurturing behaviour.
"It's children-centred and it protects the child's right to eat and drink while out in public."
She hopes the new law will contribute to a positive change in attitudes towards nursing mothers, making them less anxious about breastfeeding in public.
It covers women breastfeeding as well as anyone feeding milk to toddlers in licensed premises, like pubs and restaurants, where children are already allowed in.
Rosie Dodds, of the National Childbirth Trust (NCT), said it was delighted that the bill had passed through parliament and would become law by early next year.
"We know that many women stop breastfeeding in the first few weeks, often because they feel unsupported," she said.
"We therefore welcome this landmark legislation, which will establish a mothers' right to breastfeed her baby whenever and wherever they are together and convey the message that breastfeeding is a positive choice to be supported by society rather than discouraged."
During Thursday's debate Socialist MSP Carolyn Leckie came under fire for her use of words within the chamber.
She condemned the "intolerance and hypocrisy" about breastfeeding in society and said: "There are tits all over the newspapers, tits all over newsagents' shelves,
tits all over the telly, tits in the cinema, tits in advertising hoardings and no doubt tits in the parliament."
Deputy Presiding Officer Trish Godman quickly intervened and told Ms Leckie not to use the word again.
The Scottish National Party's Stewart Stevenson and his colleague Stewart Maxwell accused her of trying to secure publicity through her comments.
But Ms Leckie hit back at the "grossly unfair allegations", which she said were part of the "abject hypocrisy" she had been speaking of.
Health Minister Andy Kerr said the bill would make a "significant contribution" to public health.
Mr Kerr said: "It will help to give children the best start in life and ensure that mothers are confident to breastfeed their babies where and when they need to without fear of judgement and recrimination.
"Evidence suggests that breastfeeding reduces the risk of mortality and morbidity from a range of illnesses including respiratory infection and urinary tract infection in babies and reduces the incidence of breast and ovarian cancer in mothers."