By Letitia Stein and Brendan O'Brien

(Reuters) - A federal judge has blocked a Mississippi law intended to allow people who object on religious grounds to refuse wedding and other services to lesbian, gay, bisexual and transgender people.

U.S. District Judge Carlton Reeves, in a ruling late on Thursday, said that the wide-ranging law adopted this spring unconstitutionally allowed "arbitrary discrimination" against the LGBT community, unmarried people and others who do not share such views.

"The state has put its thumb on the scale to favor some religious beliefs over others," wrote Reeves, who issued a preliminary injunction halting the law that was to take effect on Friday.

Mississippi is among a handful of southern U.S. states on the front lines of legal battles over equality, privacy and religious freedom after the U.S. Supreme Court last year legalized same-sex marriage in all 50 states.

Mississippi's "Protecting Freedom of Conscience from Government Discrimination Act" sought to shield those who believe that marriage involves a man and a woman and that sexual relations should occur within such marriages. The law also protected the belief that gender is defined by sex at birth.

By citing those three religious grounds, the law would have allowed people to refuse to provide a wide range of services, from baking a wedding cake for a same-sex couple to counseling and fertility services. It also permitted dress code and bathroom restrictions to be imposed on transgender people.

Reeves, a judge in U.S. District Court for the Southern District of Mississippi, said the law violated the guarantee of religious neutrality and the promise of equal protection under the law by granting special rights to citizens holding certain beliefs.

The law "favors Southern Baptist over Unitarian doctrine, Catholic over Episcopalian doctrine, and Orthodox Judaism over Reform Judaism doctrine," he said.

LEGAL BATTLE CONTINUES

Mississippi Governor Phil Bryant, a Republican, signed the measure into law in April. The state has defended it as a reasonable accommodation intended to protect businesses and individuals seeking to exercise their religious views.

"I look forward to an aggressive appeal," the governor said in a statement on Friday.

But state Attorney General Jim Hood, a Democrat named as a defendant in the lawsuit, issued a strongly worded statement in which he said he would have to "think long and hard" about whether to spend taxpayer money on an appeal.

"The fact is that the church-going public was duped," Hood said, noting that Mississippi already has a law to protect those seeking to exercise religious freedoms.

"There will be a case in the future in which the U.S. Supreme Court will better define our religious rights," he added. "This case, however, is not that vehicle."

An appeal would bring the case before the U.S. Fifth Circuit Court of Appeals, said Roberta Kaplan, an attorney for the Campaign for Southern Equality, one of the plaintiffs.

Critics say the Mississippi law is so broad that it could apply to nearly anyone in a sexual relationship outside of heterosexual marriage, including single mothers. Several legal challenges were filed against various aspects of the law.

Earlier this week, Reeves addressed a provision allowing clerks to recuse themselves from issuing marriage licenses to gay couples based on religious beliefs, saying they had to fulfill their duties under the Supreme Court ruling.

His ruling on Thursday came after religious leaders, including an Episcopal priest and a Jewish rabbi, last week testified that the law did not reflect their religious views. The judge also heard about its harmful potential from members of the gay community.

“As a member of the LGBT community and as minister of the Gospel, I am thankful that justice prevailed,” said plaintiff Susan Hrostowski, an Episcopal priest.

(Additional reporting by Colleen Jenkins; Editing by Frances Kerry and Leslie Adler)