Legislation giving unmarried and same-sex partners the legal right to adopt has been approved at Holyrood.
The bill aims to help find family homes for more children
MSPs overwhelmingly rejected an amendment to the new adoption bill by SNP MSP Roseanna Cunningham to prevent gay couples adopting together.
The law, which aims to reverse the decline in numbers offering to adopt, was opposed by the Catholic Church.
The Adoption and Children (Scotland) Bill was approved by 101 votes to six, with six abstentions.
Under the previous law, only married couples or a single person could adopt.
Education Minister Hugh Henry said the legislation was a comprehensive overhaul of the existing adoption laws, which are almost 30 years old.
He said circumstances had changed since the current law was introduced in 1978, with more families now affected by drugs and alcohol.
Over the last 20 years the number of adoption applications has gone from about 1,000 a year to 400.
Mr Henry said ministers wanted to see more married people coming forward to adopt children.
But he added: "We also recognise that there are others who can be equally loving, equally caring and who are in stable environments who also wish to adopt whether or not they are married and we need to reflect that in our legislation."
Ms Cunningham's amendment was defeated by 98 votes to 11.
She claimed the majority of people in Scotland had concerns about allowing same-sex couples to adopt.
Cardinal Keith O'Brien, head of the Catholic Church in Scotland, also voiced his disapproval of the bill.
"The natural way in which children have been brought up is the traditional way since the beginning of time - one woman, one man and a number of children," he said.
The Conservative education spokesman Lord James Douglas-Hamilton welcomed the move to allow same-sex couples to adopt jointly.
He said: "In my view to have discrimination against a whole group is not in accordance with the spirit of the 21st Century."
Green MSP Patrick Harvie, who is a gay rights campaigner, said: "I am very glad that we can make that recognition on the basis of equality for all of those adoptive parents based on the way we are passing this bill."
Labour backbencher Elaine Murray said the bill was not about anybody's right to adopt or challenging homophobia.
"It is about increasing the opportunities for children who are no longer able to live with their birth parents to become part of a loving and stable family," the Dumfries MSP said.
Adam Ingram, the SNP's deputy spokesman for children, said the bill made sure the interests of the child were paramount.
He said: "The fact that the bill extends the pool of adopters beyond married couples is to be welcomed, given that nowadays there are many alternative family arrangements which can provide security and stability in the best interests of children."