Italy's parliament has backed same-sex civil unions in a vote of confidence for centre-left Prime Minister Matteo Renzi.
Until Wednesday's vote Italy had been the last major Western democracy not to legally recognise gay partnerships.
The issue has been highly controversial in Italy, amid staunch opposition from Catholic conservatives.
MPs in the lower house voted 369-193 for the government, ensuring that the civil unions bill will become law.
Ahead of the vote, Mr Renzi wrote on Facebook that "today is a day of celebration for so many".
Final approval of civil unions is expected later on Wednesday, but that vote by MPs is seen as a formality, as the confidence vote was the crucial hurdle.
After many delays the civil unions bill was watered down in order to secure the necessary support.
Civil unions bill
- Does not go as far as civil union laws elsewhere in Europe, the US and Canada, critics say
- Clause that would have enabled gay people to adopt a partner's biological children was dropped
- No blanket ban on adoption, but family judges will decide on a case-by-case basis
- Requirement for gay couples to pledge loyalty was dropped - to make civil union less like marriage
- Gay couples get right to take each other's names and receive deceased partner's pension
'A first step'
Last year, the European Court of Human Rights ruled that Italy had violated human rights by failing to offer enough legal protection for same-sex couples.
In February this year the Italian Senate - the upper house - approved the civil unions bill, after the text had been watered down.
The bill's main sponsor, Democratic Party (PD) Senator Monica Cirinna, called the compromise version a "hollow victory" and only "a first step".
"This is a very important measure, but I am also thinking of the children of so many friends," she said, referring to the concession over gay adoptions.
The head of the Italian Arcigay campaign group, Gabriele Piazzoni, said "the glass is half full".
"The text contains the recognition and protection many gays and lesbians have been waiting for all their lives," he said, but added that the omissions from the law "leave a bitter taste".
Among the opponents, Nunzio Galantino, secretary general of the Italian Bishops' Conference (CEI), called the civil unions bill "a defeat for everyone".
Mr Renzi faced opposition from Interior Minister Angelino Alfano, who objected to allowing gay adoption because of fears that it could encourage surrogacy. He likened the hiring of a surrogate mother to a sex crime.
In a Facebook post, published before the confidence vote, Mr Renzi spoke fondly of a party colleague, Alessia Ballini, who died of cancer aged 41.
While serving in Mr Renzi's Florence administration, before he became prime minister, she campaigned for gay rights and against homophobia.
"In these crucial hours I keep close to my heart the thought and memory of Alessia," Mr Renzi said. "And that's enough for me. Because laws are made for people, not for ideologies. For those who love, not for those who make declarations.
"Let's write another important page for the Italy that we want."