Flags are waved during the National LGBT 50th Anniversary Ceremony, Saturday, July 4, 2015. (AP Photo/Matt Rourke)

Citing his First Amendment rights and religious protections under the Civil Rights Act, a Social Security Administration judge in Texas who refused to watch an LGBT diversity training video is suing his superiors to avoid being fired, saying he was subject to a “religiously hostile work environment.”

Judge Gary Suttles said in a complaint filed Thursday in federal court in Texas that the Social Security Administration, or SSA, should be barred from taking any disciplinary action against him at least until his religious discrimination claims are heard by a federal employment panel.

“The agency has wholly failed to work in good faith to reasonably accommodate Judge Suttles’ sincerely held religious belief against watching” the video, the complaint says.

The agency violated his rights, the complaint says, “by discriminating against him on the basis of his religion, creating a religiously hostile work environment,” and by “retaliating against him for his protected activity of seeking a religious accommodation.”

A representative from the SSA was not immediately available for comment on Tuesday.

Suttles’s case comes amid a sweeping expansion of LGBT rights, during which courts have ruled against bakers, florists and others who say anti-discrimination measures clash with their religious liberties. Social conservatives and some Christians argue that the government should not be able to force them to offer their services to same-sex couples, and they have sought religious freedom exemptions as recourse.

Some of the most high-profile cases have played out in the business world, including a lawsuit against a Christian baker who refused to make a wedding cake for a same-sex couple. But government officials have drawn attention for their defiance, too, among them Kim Davis, the county clerk in Kentucky who refused to issue same-sex marriage licenses in violation of a Supreme Court ruling.

Suttles was hired as an administrative law judge in the Houston District office of the SSA in 2005. In the time since, he has never received a reprimand or warning, his complaint says.

In May, one of the office’s directors sent an email ordering employees to watch a video called “Lesbian, Gay, Bisexual and Transgender (LGBT) Community.” The 17-minute video included a message from the agency commissioner and “a brief session on tips for increasing cultural awareness in a diverse and inclusive environment,” according to the complaint. The email said the SSA was responding to a 2011 executive order from President Obama that instructed federal agencies to develop new workplace diversity and inclusion plans.

Suttles wasted no time telling the office director he would not watch the video.

“I am already fully aware to treat all persons with respect and dignity and have done so my entire life,” he said in an email the next day, according to the complaint. “Furthermore, this type of government indoctrination training does not comport with my religious views and I object on that basis as well.

Monica Anderson, the hearing office’s chief administrative law judge, responded with a sharply-worded message giving Suttles a “direct order” to watch the training video. “Failure to follow this directive may lead to disciplinary action,” the chief judge said, according to the complaint. Anderson also denied Suttles’s request for a religious accommodation, saying the agency needed to ensure “all employees know about and comply with this.”

The back and forth carried on for a few months. Suttles suggested that the agency give him a pass by allowing him to take a professional ethics course or “alternative diversity” course that “did not deal with such a specific community of people.” Anderson declined, proposing instead that Suttles read a transcript of the video. Suttles again refused.

“Judge Suttles continued to refuse to watch the mandatory,” the complaint says, “because it is the substantive content of which, not the medium by which the content was delivered that violates his faith.”

By the fall, Suttles’s case had made its way to the regional chief administrative law judge, who issued an official reprimand and warned Suttles that “future acts of misconduct” could result in more serious punishment, including removal from the job. (Administrative law judges, unlike federal court judges under Article III of the Constitution do not have life tenure.) The reprimand barred Suttles from working from home or requesting a job transfer for one year, according to the complaint.

Suttles claims the action was retaliatory. He reported the episode to an Equal Employment Opportunity counselor, alleging the agency violated his First Amendment right to free exercise of religion, as well as his rights under Title VII of the Civil Rights Act, which prohibits discrimination based on several factors, including religion.

According to the complaint, the Equal Employment Opportunity Commission will not finish its initial review of his case until mid-March. In the meantime, the deadline for Suttles to watch the video has lapsed. The judge said the agency “has made it quite evident that it does not intend to wait” to discipline him.

Suttles says he will suffer “irreparable harm” unless the court prevents the agency from disciplining him or forcing him to watch the video.

Though his complaint describes a “sterling work record,” Suttles was criticized and investigated by the SSA in 2015 after he scoffed at a Gulf War veteran’s post-traumatic stress disorder during a disability benefits hearing. Suttles questioned whether the veteran, a 44-year-old who served as a fueler on an aircraft carrier, had experienced true trauma during the war.

“I mean, hey, you were in the Navy. You weren’t even fighting on the ground,” Suttles told him, according to the Austin American-Statesman. “To me it would have been exciting. What do you mean stressful?”

The remarks were condemned by veterans groups at the time. The SSA ultimately rejected calls to temporarily remove Suttles from his job.