Scotland looks set to be the first country in the UK to allow gay marriages in churches and civil ceremonies, despite a majority of people opposing the change in an official poll.
Deputy first minister Nicola Sturgeon, of the governing Scottish National Party (SNP), said legalising same-sex marriages was "the right thing to do", and confirmed the government would bring forward a bill on the issue.
If the bill progresses without significant delay, the first same-sex ceremonies are likely to take place in 2015.
However a public consultation, commissioned by the SNP, has shown that the majority of the Scottish public remain opposed to same-sex marriages.
Of the 77,000 people who responded to the study, 64 percent said they were against the idea of same-gender unions being consecrated in church.
Despite the criticism, Sturgeon said: "We [the SNP] believe that, in a country that aspires to be an equal and tolerant society, as we do in Scotland, then this is the right thing to do.
"However, we recognise and respect, the concerns that some people have expressed, in particular the concerns that have been expressed by the churches, and we're determined the legislation we bring forward will be accompanied by protection for freedom of speech and freedom of religion."
Sturgeon emphasised that the consultation was just one factor when the government reached its decision, and they also took into account support for gay marriage from the leaders of all the other main political parties in Scotland.
She added that no religious bodies will be forced to conduct same-sex marriages, and those who want to conduct the ceremonies will have to "opt in" by adding their names to a public register.
"This is a very controversial issue. There is no getting away from that," said Sturgeon.
"There are very deeply held views on this issue on both sides of the debate. It is not possible to completely reconcile these different views. But as we proceed with this issue, the Scottish government will continue to be respectful of differences of opinion."
Gay rights groups and same-sex couples expressed delight at the SNP's decision.
Tom French, co-ordinator for the Equality Network umbrella group, said:
"Same-sex marriage is about equality and freedom. The freedom for couples, and religious and humanist groups that want to, to celebrate same-sex marriages. But equally, upholding the freedom of other religious groups to say no to same-sex marriages. That's the right way for Scotland to deal with the different opinions on this."
Jaye and Ruth Richards-Hill, a lesbian couple from Glasgow, said: "We are no longer treated like second-class citizens by our government. We are thrilled that we can now get the religious wedding that we deserve."
However the SNP's move was quickly condemned by the Catholic Church, which labelled it a "dangerous social experiment".
A spokesman for the Catholic Church in Scotland told the Associated Press: "The Scottish government is embarking on a dangerous social experiment on a massive scale. The church looks much further than the short-term electoral timescales of politicians."