Greece has become the first Orthodox Christian country to legalise same-sex civil marriage, despite opposition from Church officials.
A cross-party majority of 176 lawmakers in the 300-seat parliament voted late Thursday in favour of the bill drafted by Prime Minister Kyriakos Mitsotakis' centre-right government.
Another 76 rejected the reform while two abstained from the vote and 46 were not present for the vote.
The new law recognises parental rights for same-sex couples, but will not allow gay men to acquire biological children through surrogate mothers in Greece.
Opinion polls have suggested that most Greeks support the reform by a narrow margin.
The issue has failed to trigger deep divisions in a country more worried about the high cost of living.
The landmark bill drafted by Prime Minister Kyriakos Mitsotakis' centre-right government was backed by four left-wing parties, including the main opposition Syriza.
Three small far-right parties and the Stalinist-rooted Communist Party rejected the draft law.
Supporters, waving rainbow banners, and opponents of the bill, holding religious icons and praying, held separate small, peaceful gatherings outside parliament Thursday.
Prime Minister Kyriakos Mitsotakis told lawmakers ahead of the evening vote: "People who have been invisible will finally be made visible around us. And with them, many children (will) finally find their rightful place.
"Both parents of same-sex couples do not yet have the same legal opportunities to provide their children with what they need," he added.
"To be able to pick them up from school, to be able to travel, to go to the doctor, or take them to the hospital...That is what we are fixing."
The bill would confer full parental rights on married same-sex partners with children. But it precludes gay couples from parenthood through surrogate mothers in Greece, an option currently available to women who cannot have children for health reasons.
Maria Syrengela, a lawmaker from the governing New Democracy, or ND, said the reform redresses a long-standing injustice for same-sex couples and their children.
She said: "And let's reflect on what these people have been through, spending so many years in the shadows, entangled in bureaucratic procedures."
Dissidents among the governing party included former Prime Minister Antonis Samaras, from ND's conservative wing, who opposed the law.
"Same-sex marriage is not a human right...and it's not an international obligation for our country," he told parliament. "Children have a right to have parents from both sexes."
Polls show that while most Greeks agree to same-sex weddings, they also reject extending parenthood through surrogacy to male couples.
Same-sex civil partnerships have been allowed in Greece since 2015. But that only conferred legal guardianship to the biological parents of children in those relationships, leaving their partners in a bureaucratic limbo.
The main opposition to the new bill has come from the traditionalist Church of Greece - which also disapproves of heterosexual civil marriage.
Church officials have centered their criticism on the bill's implications for traditional family values, and argue that potential legal challenges could lead to a future extension of surrogacy rights to gay couples.