London (CNN) -- A bill to allow same-sex marriage in England and Wales is now law, though the unions aren't expected to take place until 2014.
Queen Elizabeth II has given her assent to the landmark bill, which the British House of Commons passed Tuesday, the house's speaker, John Bercow, said Wednesday.
The first same-sex wedding could be held as early as next summer.
The law does not come into force immediately because government departments need time to make changes. New processes must be drawn up for registrars, and new forms will also have to be drawn up.
The government expects to announce a more formal timetable for the implementation of the law in the fall.
The Marriage (Same Sex Couples) Bill cleared the House of Lords and the House of Commons this week, just before the summer recess. The monarch's assent -- a formality in the United Kingdom -- makes the measure official.
The bill had the backing of British Prime Minister David Cameron, but his commitment to it put him at odds with many in his Conservative Party and its grass-roots supporters. The Conservatives govern in coalition with the Liberal Democrats.
The bill was also opposed by religious groups, including the Church of England.
The Catholic Church in England and Wales said that the law's passage "marks a watershed in English law and heralds a profound social change," and that it regretted that the bill had been "rushed though" Parliament.
"With this new legislation, marriage has now become an institution in which openness to children, and with it the responsibility on fathers and mothers to remain together to care for children born into their family unit, are no longer central. That is why we were opposed to this legislation on principle," a statement said.
'Go forth and propose'
The debate over the legislation became heated at times in the House of Commons, where the issue exposed divisions within Cameron's party.
Conservative MP Gerald Howarth angered many when he referred to "the aggressive homosexual community" that would "see this is as but a stepping stone to something even further."
Responding to the news that the law had passed, Labour lawmaker Chris Bryant tweeted: "The Queen has given Royal Assent to Same Sex Marriage. Aggressive homosexuals, please note. Go forth and propose."
The new law will allow same-sex couples to marry in civil or religious ceremonies.
However, religious organizations must explicitly "opt in" if they want to perform such ceremonies, and the religious minister conducting the ceremony must also agree.
The law also protects religious organizations and their representatives who don't wish to conduct marriages of same-sex couples from being challenged in the courts.
It will allow couples in civil partnerships to convert to marriage if they wish. The new law also allows married men or women who wish to change their gender to do so without ending their marriage.
A law recognizing civil partnerships in England and Wales was passed in 2004.
The issue of same-sex marriage has also divided other nations.
A law that allows same-sex couples to marry and adopt was passed by France this year, despite large street protests and vocal opposition from religious groups. The move made it the ninth country in Europe to allow same-sex marriage.
In the United States, two landmark rulings by the Supreme Court last month gave the gay and lesbian rights movement huge political and legal momentum.
The justices said legally married same-sex couples will now enjoy the same federal benefits as heterosexual couples, striking down a key provision in the Defense of Marriage Act.
And although not granting a sweeping right of gays and lesbians to marry nationwide, a separate high court ruling effectively allows same-sex marriage to resume in California, the nation's most populous state.
CNN's Saskya Vandoorne contributed to this report.