New legislation banning discrimination against gays, lesbians and bisexuals is lawful with just one exception, a High Court judge has ruled.
The issue of homosexuality has proved controversial
Mr Justice Weatherup said harassment provisions in the Sexual Orientation Regulations must be removed.
The judgement means providers of goods, services and education can be fined up to £15,000 for breaching regulations.
But they cannot be prosecuted for stating their opposition to giving a room to a gay or lesbian couple.
The judgement followed a five-day hearing last June when the Christian Institute and numerous churches applied for a judicial review of the regulations which they claimed were a "gay rights charter."
It was also argued that the regulations were a "blatant infringement" of religious liberty which could be used to override matters of Christian conscience or to harass Christians in their belief.
Colin Hart said freedom of speech was preserved
At the end of his 42-page judgement, Mr Justice Weatherup dealt with the Northern Ireland Act, and added: "The applicants contend that the regulations treat evangelical Christians less favourably than other persons to the extent that they are subject to civil liability for manifesting the orthodox belief in relation to homosexuality.
"I am satisfied that the regulations do not treat evangelical Christians less favourably than others."
Colin Hart, director of the Christian Institute, said he was delighted that the harassment portion of the legislation had been struck down.
"It means that freedom of speech is preserved," said Mr Hart.
Rita Wild of the Lesbian Advocacy Services Initiative also said it was a victory.
She added: "Of course there is disappointment. The harassment provision would have been fantastic had it held because it is desperately needed. However, the regulations which are extraordinary broad in their scope have stayed.
"So actually it is a real triumph."
The other applicants in the case were the Reformed Presbyterian Church, the Congregational Union, the Evangelical Presbyterian Church, the Association of Baptist Churches, the Fellowship of Independent Methodist Churches and Christian Camping International.
Rita Wild said she was pleased with the outcome
After the case started the Catholic Church, the Human Rights Commission, the Equality Commission and the Coalition on Sexual Orientation, representing the lesbian, gay and sexual transgender community, were admitted as "intraveners."
The regulations came into force last January when former secretary of state Peter Hain was accused of rushing the powers into law by limiting consultation to six weeks whereas people in the rest of the United Kingdom were given six months to examine the controversial issues.
It was on the consultation ground that Mr Justice Weatherup said the harassment provisions had to be set aside.