Denmark, a pioneer in gay rights, on Thursday saw its parliament vote overwhelmingly in favour of allowing homosexuals to marry in the state Evangelical Lutheran Church.
The bill presented by Denmark's centre-left government earlier this year passed with 85 votes in favour and 24 opposed, with two abstaining and the rest of the 179-seat house absent.
Denmark was the first country in the world to allow gay couples to enter into civil unions in 1989, and homosexuals have since been given the right to receive a church blessing for their unions, but Thursday's vote sealed their right to have a full marriage ceremony in church.
Pastors in the state church will however not be obliged to marry homosexual couples if they feel it goes against their personal beliefs, according to an annex to the bill.
Denmark has long been at the forefront of gay rights, and in 2009 homosexuals in the Scandinavian country were also given the right to adopt children.
Danish Minister for Ecclesiastical Affairs Manu Sareen, who initiated Thursday's legislation, said she was thrilled it had passed.
"This is equality between couples of the same gender and couples of different genders. A major step forward," she told reporters following the vote.
The only party to vote against the bill as a whole was the populist Danish People's Party, which maintained that marriage in Christian terms was between a man and a woman and that the Church should not be forced to make a religious marriage ceremony available for homosexual couples.
The Christian Democratic Party, which is no longer in parliament, meanwhile announced Thursday it aimed to initiate a class action suit against the new law, which is set to go into effect on June 15, saying it was an infringement on the right to free religious belief and was thus unconstitutional.
Per Oerum Joergensen, a former member of parliament for the Christian Democrats, told the Politiken daily he had seen a recent poll showing "that some 440,000 members of the Church were considering renouncing their membership because of all this."
"They will be able to join the suit against the state," he said.
Around 80 percent of Danes, or around 4.5 million people, are today members of the state church.