Protesters call for Mississippi Gov. Phil Bryant to veto House Bill 1523, which they says will allow discrimination against LGBT people, during a rally outside the Governor's Mansion in Jackson, Miss., April 4, 2016. (Rogelio V. Solis/AP)

The Alliance Defending Freedom, a powerful Christian legal advocacy group, played a key role in helping Mississippi’s legislature and governor write, promote and legally justify HB 1523, the controversial “religious freedom” bill that was recently struck down by a federal judge, court documents filed late Wednesday show.

The Arizona-based nonprofit organization first offered its help to Mississippi Gov. Phil Bryant (R) before the Supreme Court legalized gay marriage last June, emails obtained by opposing attorneys show. The behind-the-scenes help continued through Bryant’s signing statement, the final step in the legislative process, according to the emails.

“We looked through a number of Gov. Bryant’s signing statements and tried to use his voice,” Kellie Fiedorek, an ADF lawyer, wrote to one of Bryant’s attorneys on March 31, offering two different drafts, just before Bryant signed the bill. “Please feel free to pull from either one that is most helpful to you and your boss. . . . we’re here to serve.”

The ADF, which has helped several states draft “bathroom” bills targeting transgender people, is now helping represent Bryant and John Davis, the executive director of the Mississippi Department of Human Services, in appealing U.S. District Judge Carlton W. Reeves’s June 30 injunction against HB 1523.

The bill would let government workers and business owners deny service to same-sex couples if doing so offended their religious beliefs.

The ADF’s involvement, tacitly acknowledged by in-state HB 1523 supporters in a Mississippi Today article in May, was confirmed in filings Wednesday by the Campaign for Southern Equality in the U.S. District Court for the Southern District of Mississippi. The group obtained 62 pages of emails through a Freedom of Information Act request.

Lobbying groups often offer model legislation and talking-points support to elected officials. There is nothing unusual or illegal about the exchanges revealed between Bryant’s attorneys and ADF staff.

It is notable, however, because state officials did not disclose aid from the organization. It was officially written by Mississippi state Rep. Philip Gunn (R), the speaker of the House, and passed both the House and Senate easily. Bryant signed it immediately and has ardently defended it.

ADF justified its involvement in a statement to The Washington Post.

“We have provided legal advice to representatives at every level and branch of government for more than 20 years, no different from what many groups that oppose religious freedom do all the time,” wrote ADF attorney James Campbell in an email. Campbell, listed as one of Bryant’s attorneys of record on the appeal, described ADF’s involvement on HB 1523 as “both unsurprising and unobjectionable.”

Attorneys for Bryant’s office did not immediately return calls and emails Wednesday evening.

Roberta Kaplan, the New York-based attorney for the Campaign for Southern Equality who led one of four legal challenges against the bill, filed the FOIA request. In court filings, she wrote that “HB 1523 was drafted by the ADF, was promoted by the ADF and other conservative Christian groups, and that, as a result, HB 1523 improperly and unconstitutionally reflects the sectarian Christian values of these organizations.”

The earliest email listed is dated June 24, 2015, from ADF lawyer Austin R. Nimocks to Drew Snyder, a lawyer in Bryant’s office.

“I pray this finds you well,” Nimocks begins one email. He says an attachment is a “model executive order that would prevent state governments from discriminating against their citizens because of their views or actions concerning marriage.”

The resulting bill adopted many of the identical passages, Kaplan said in her brief.

One of the attachments to the filings is a line-by-line comparison by Kaplan of the ADF’s five-page model and the final bill.

“Like HB 1523, [the model] identifies three religious beliefs for special protection: “(1) marriage is or should be recognized as the union of one man and one woman; (2) sexual relations are properly reserved to such a marriage; (3) [man] or [woman] refer to an individual’s immutable biological sex as objectively determined by anatomy and genetics by time of birth,” Kaplan wrote.

Mississippi Attorney General Jim Hood, the only Democrat named in the lawsuits, declined to appeal the injunction, prompting Bryant and Davis to file their own appeals with pro-bono representation.

“Wherever hateful ­anti-LGBTQ legislation pops up, the Alliance Defending Freedom is usually not far behind,” said Rob Hill, Mississippi director for the Human Rights Campaign, an LGBT civil rights advocacy organization. “H.B. 1523 never reflected the true values of Mississippians, so it’s no surprise that Governor Bryant, Lt. Governor Reeves and Speaker Gunn enlisted ADF when crafting one of the most overtly discriminatory laws in the United States.”