Same-sex religious marriages can take place in Northern Ireland from September, it has been announced.
The Northern Ireland Office has confirmed regulations were laid in Westminster on Thursday.
There are, however, exemptions and protections for religious bodies which do not wish to conduct same-sex marriages.
Same-sex marriage has been legally recognised in Northern Ireland since January.
That did not extend to ceremonies in churches, or to religious bodies.
The Northern Ireland Office then opened a consultation on extending that provision to religious same-sex marriages and the latest regulations are based on the results of that.
The UK government said religious bodies cannot be "compelled by any means" to carry out services.
Couples can give their 28 days' notice of intent to have a religious service from 1 September, which means the first ceremonies could take place on 29 September.
'Protections' in place'
The legislation contains equality law protections so that religious bodies and officiants cannot be held to be unlawfully discriminating against same-sex couples if they refuse to marry them.
That protection has also been extended to cover church halls and other buildings owned by a church.
Teacher Rebecca McKinley and her partner of six years youth worker, Katie Broadhurst, are from Ballyclare.
They plan to have a religious wedding next year.
They both grew up in religious households and said their faith is central to their relationship.
Rebecca told the BBC's Evening Extra programme that for them not to have the choice of having a religious wedding ceremony felt unfair and stopped them from exploring their religion freely.
"We would certainly never ask a church to marry us if that's not what they felt their belief was," she said.
"I think there's real value in diversity of beliefs and opinions, but it felt unfair that we couldn't exercise our freedom to explore that option, or choose it."
A UK government spokesperson said: "The regulations ensure appropriate protections and exemptions are in place for those religious bodies and officiants who do not wish to solemnise same-sex religious marriages.
"The regulations deliver equivalent rights and protections to the rest of the UK in practice."
'Landmark day for equality'
Same-sex marriage campaigners have welcomed the move, but are now urging the government to make marriage fully equal by allowing same-sex couples with an existing civil partnership to be able to convert their partnership into a marriage.
Patrick Corrigan, Amnesty International's Northern Ireland Director said it was "a landmark day for equality in Northern Ireland".
"After a long campaign, same-sex couples of faith will finally be able to marry in a church or other religious setting," he said.
Mr Corrigan welcomed the fact the new law will protect religious freedom and that churches will not be "compelled nor prevented" from offering same-sex ceremonies.
"We now urge the government to finish the job of marriage equality in Northern Ireland without further delay, by allowing couples in civil partnerships to convert to married status if they so wish," he added.