Italy's parliament approved same-sex civil unions and gave some rights to unmarried heterosexual couples on Wednesday after Prime Minister Matteo Renzi called a confidence vote to force the bill into law.
Italy is the last major Western country to legally recognise gay couples and an original draft law had to be heavily diluted due to divisions in Renzi's ruling majority.
The bill had faced stiff opposition from Catholic groups who said it went too far, while gay activists said it was too timid.
While parliament was voting, gay rights groups gathered outside with a banner reading: "This is just the beginning."
"Today is a day of celebration in which Italy has taken a step forwards," Renzi said in a radio interview after the legislation was approved.
The 41-year-old premier promised to prioritise legislation for gay rights when he took office in early 2014, but the bill has proven to be one of the most contested of a raft of initiatives he has pushed through parliament.
The bill, originally presented in 2013, cleared its final real hurdle earlier on Wednesday with the confidence vote in the Chamber of Deputies, which passed it by 369 votes to 193. The chamber then rubber-stamped the bill with a final ballot.
"There is still a long way to go for full equality but this is an excellent starting point," said Gabriele Piazzoni, president of gay rights group Arcigay.
The bill gives gay couples the right to share a surname, draw on their partner's pension when they die and inherit each other's assets in the same way as married people.
"STILL WORK TO DO"
"There is still work to do on adoptions ... There is still work to do on lots of areas that still exclude a section of Italian citizens," Monica Cirinna, a senator from Renzi's centre-left Democratic Party who gave her name to the original bill, told state TV RAI outside parliament.
Co-habiting unmarried couples get the right to be treated as each other's next of kin if one partner is taken ill, dies or is imprisoned. They also get some rights to a shared home.
Both homosexual and heterosexual couples may also have the right to try to claim alimony at the end of a relationship.
It was the second time the bill was put to a confidence vote, which is called to curtail debate, having been approved in the upper house Senate in the same way three months ago.
The 'stepchild adoption' clause was arguably the most disputed aspect of the bill. It stoked outrage among social conservatives and Catholics who saw it as a step towards legalising surrogate motherhood, which is illegal in Italy.
The new legislation allows courts to grant homosexuals parental rights regarding each other's children in certain circumstances, a practice which has led to a handful of recent rulings in favour of homosexual parents.
A survey conducted shortly after the bill passed the Senate suggested it reflected the views of most Italians.
Shortly after the vote, deputies from conservative opposition parties said they would call for a referendum to cancel the new legislation.