Brighton: Gay couples across England and Wales said "I do" on Friday night as a law legalising same-sex marriage came into effect at midnight, the final stage in a long fight for equality.



Prime Minister David Cameron hailed what he said was an "important moment for our country", and a rainbow flag flew above government offices in London in celebration.



In Brighton on England's south coast, Neil Allard and Andrew Wale exchanged vows and rings in the opulent splendour of the Royal Pavilion in front of about 100 guests.



Wearing velvet-collared three-piece suits with white flowers in their buttonholes, the smiling couple of seven years hugged and kissed after they became "husband and husband".



They were among several couples bidding to be first to take advantage of last year's Marriage (Same Sex Couples) Act by holding midnight wedding ceremonies.



Posing for media photographs earlier this week, Wale remarked how positive the reaction to their wedding had been, with passers-by offering "lots of smiles, lots of warmth".



"We become even more aware of how lucky we are to live in a comparatively tolerant part of the world," said the 49-year-old writer and theatre director.



Many more couples plan to wed during the day on Saturday, including one pair who will perform almost the entire ceremony -- barring the legal declaration -- in song for a television programme entitled "Our Gay Wedding: The Musical".



Civil partnerships have been legal since 2005 and marriage brings no new rights -- the ability to adopt, for example, was introduced in 2002.



But campaigners have insisted that only the right to marry gives them full equality with heterosexual couples.



"We didn't want to get married until it was a marriage that my mum and dad could have, that other men or women could have," Teresa Millward, 37, told AFP earlier this week.



She is marrying her girlfriend of 11 years, Helen Brearley, in Yorkshire in northern England on Saturday morning. Both will be dressed in cream, and Millward's father will walk them both down the aisle of the register office.



The gay marriage law is the final victory in a long battle stretching back to the decriminalisation of homosexuality in England in 1967.



Cameron backed the change despite strong opposition from members of his Conservative party and the established Church of England.



"This weekend is an important moment for our country," the prime minister said.



"Put simply, in Britain it will no longer matter whether you are straight or gay -- the state will recognise your relationship as equal."



He added: "It also sends a powerful message to young people growing up who are uncertain about their sexuality. It clearly says 'you are equal' whether straight or gay."



However, not all attitudes have changed. A poll for BBC radio said 20 percent of British adults would turn down an invitation to a same-sex wedding.



The survey of 1,007 people also found 68 percent agreed gay marriage should be permitted, with 26 percent opposing it.



The Church of England had opposed same-sex marriage, insisting weddings should only take place between a man and a woman, and secured an exemption from the new law.



The House of Bishops last month also warned clergy they should not bless married gay couples.



But Archbishop of Canterbury Justin Welby, the leader of the world's 80 million Anglicans, indicated on Thursday that the Church would no longer campaign against the issue.



"I think the Church has reacted by fully accepting that it's the law, and should react on Saturday by continuing to demonstrate in word and action, the love of Christ for every human being," he told the Guardian newspaper.



In London, Peter McGraith and David Cabreza were also bidding to make history by marrying at midnight in front of friends and family, including their two adopted sons.



The couple have been together for 17 years and hope their wedding will send out a message around the world.



Fifteen countries have legalised gay marriage and another three allow it in some areas, but homosexuals remain persecuted in many parts of the world.



"There's a lot of gay men and lesbians around the world who are not invited to the party," McGraith told AFP.