Greece is the first Orthodox Christian majority country to legalize same-sex marriage.
A 176-76 vote in Congress on Thursday means same-sex couples will also be legally allowed to adopt children.
Prime Minister Kyriakos Mitsotakis said the new law “boldly abolishes deep inequalities”.
But the country is divided by fierce resistance led by the powerful Orthodox Church. Its supporters held a protest rally in Athens.
In the capital's Syntagma Square, many people carried banners, carried crosses, read prayers and sang Bible verses.
Archbishop Ieronymos, head of the Orthodox Church, said the measure “destroys the social cohesion of the homeland.”
The bill needed a simple majority to pass the 300-member parliament.
Mitsotakis supported the bill, but it needed support from opposition parties to cross the line, and dozens of MPs from the centre-right ruling party opposed it.
In a debate before the vote, the prime minister told parliament: “People who have been invisible will finally be visible all around us. And with them, many children will finally have their rightful place. We will find out,” he told Congress.
“This reform will improve the lives of some of our fellow citizens without damaging the lives of many.”
The vote has been welcomed by Greek LGBTQ organizations.
“This is a historic moment,” Stella Berria, president of same-sex parent group Rainbow Families, told Reuters. “Today is a day of joy.”
15 of the 27 European Union member states have already legalized same-sex marriage. Allowed in 35 countries around the world.
Greece had previously lagged behind some of its European neighbors, mainly due to church opposition.
It was the first country in Southeastern Europe to achieve marriage equality.