Prime Minister David Cameron has confirmed his support for the introduction of same-sex marriages in religious institutions, risking a battle within his own party.
However, he added that he will not force religious groups to carry out same-sex civil weddings at churches, synagogues, mosques or any other religious building if they choose not to.
Cameron has pledged that organisations which oppose gay marriages, such as the Church of England and the Roman Catholic Church, will not be legally obliged to perform ceromonies.
The new legislation on gay marriage is due to be unvelied next week and MPs will be given a free vote on the issue.
Cameron said in a statement: "I'm a massive supporter of marriage and I don't want gay people to be excluded from a great institution.
"But let me be absolutely 100% clear, if there is any church or any synagogue or any mosque that doesn't want to have a gay marriage it will not, absolutely must not, be forced to hold it. That is absolutely clear in the legislation.
"Also let me make clear, this is a free vote for Members of Parliament but personally I will be supporting it."
A government spokesman said: "We are committed to bringing equal civil marriage forward and the consultation results will be announced next week. We are very clear that religious organisations must be protected and that none will be forced to conduct same-sex marriage.
"EU law is very clear that this is the case and we will additionally bring in very strong legal locks to ensure that this is watertight."
It has been reported more than 100 Tory MPs intend to vote against the Coalition's plans to bring in gay marriage.
The announcement by Cameron was swiftly condemned by members of the Tory party.
Conservative MP Peter Bone claims the party is split 50-50 on the issue. He added: "Despite the PM's assurance, the redefinition of marriage - because of the European Convention on Human Rights - will force churches to marry same-sex couples. This will outrage millions of people and hugely damage the Government in electoral terms."
Conservative MP Mark Pritchard tweeted: "Exemptions for places of worship in the same-sex marriage bill likely to be ruled unlawful by the Supreme Court or the ECHR within months". He added that the introduction of gay marriage would "undo much of the good outreach work the party has done with Muslim, Sikh, and Hindu communities".
Benjamin Cohen, of Out4Marriage, which has been campaigning in favour of same-sex weddings, said: "We're delighted to hear that the Government will be legislating to introduce full equal marriage including same-sex marriages solemnised by religious ministers.
"The Prime Minister and Deputy Prime Minister both told us during the summer that such a move had their personal support. We're glad that this personal support is being translated into Government action.
"Legislation must give individual religious organisations the freedom to decide for themselves whether to hold same-sex marriages. None should be forced to, but those that wish to must be given the rights to do so."
Deputy Prime Minister Nick Clegg has also publicly backed the proposal, telling the Evening Standard in June: "We shouldn't stop any church that wants to conduct gay marriage."