British lawmakers have passed a bill legalising same-sex marriage in England and Wales, paving the way for the first gay weddings in 2014.
MPs decided not to oppose a number of minor amendments to the Marriage (Same Sex Couples) Bill proposed by the upper House of Lords.
The legislation is now expected to receive official assent from head of state Queen Elizabeth II later this week after MPs agreed to changes such as ensuring protections for transgender couples.
Jubilant gay rights activists had danced outside parliament on Monday night as the government-backed bill passed unopposed through the upper House of Lords, where some members wore pink carnations.
A spokesman for the culture ministry, which is overseeing the new law, said the bill would probably receive royal assent on Wednesday or Thursday.
"But we are looking at seeing the first gay weddings in the middle of 2014 because there are various issues to sort out, such as its impact on pensions," the spokesman told AFP.
Government computer systems also need to be updated to allow same-sex marriages to be registered, at an estimated cost of 2 million ($3 million, 2.3 million euros).
But the government hopes legalising gay marriage will bring an overall boost to the economy, estimating that the change could bring in up to 14.4 million a year for caterers, hotels and the rest of the wedding industry.
The bill survived a stormy passage through parliament, with dozens of members of Prime Minister David Cameron's own Conservative party voting against it.
An attempt in the Lords last month to kill off the legislation with a "wrecking amendment" failed.
Deputy Prime Minister Nick Clegg, who leads Cameron's junior coalition partners, the Liberal Democrats, said the new law would ensure that gay couples felt "recognised and valued, not excluded".
Gay rights activists have vowed to press on for equal marriage in the United Kingdom's other two nations, Scotland and Northern Ireland.
But opponents of gay marriage have warned that the legislation will "come back to bite" Cameron.
The Coalition for Marriage campaign group said it would mobilise a 700,000-strong support base ahead of next year's European elections and the general election in 2015.
"They are passionate, motivated and determined to fight on against a law that renders terms like 'husband and wife' meaningless," said the group's chairman Colin Hart.
Civil partnerships for gay couples have been legal in Britain since 2005, giving them identical rights and responsibilities to straight couples in a civil marriage.
But campaigners point to differences, such as gay couples' inability to choose a religious ceremony -- and their inability to call their partnership a "marriage".
The new law will ban the established Churches of England and Wales -- which are opposed to gay marriage -- from conducting ceremonies.
Other religious institutions will be able to "opt in" if they wish.
Scotland and Northern Ireland have their own laws on the matter.
The Scottish government published its own same-sex marriage bill last month, but Northern Ireland's assembly voted to block a similar measure.
France became the 14th country to legalise same-sex marriage in May, joining The Netherlands, Spain, Canada, South Africa, Norway, Sweden, Portugal, Iceland, Argentina, Denmark, Uruguay, Belgium, and New Zealand.
Gay couples can marry in 13 US states, as well as in the capital Washington DC, while parts of Mexico also allow same-sex marriage.