Gay marriages are to be allowed in churches and other religious buildings under Government plans to be launched by Culture Secretary Maria Miller next week.
"I'm a massive supporter of marriage and I don't want gay people to be excluded from a great institution," said Prime Minister David Cameron.
"But let me be absolutely 100 per cent 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.
"Also let me make clear, this is a free vote for Members of Parliament but personally I will be supporting it."
The announcement threatens to put the Prime Minister on a collision course with some of his own backbenchers, who insist that marriage should be allowed only between a man and a woman.
Churches including the Church of England and Roman Catholics voiced opposition to same-sex marriage during a consultation carried out by the Home Office over the summer.
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."