NORFOLK, VIRGINIA — A federal judge on Monday dismissed one of the key legal arguments brought by lawyers for a transgender student suing to use the boys restroom at his Virginia high school. Stating that being transgender is a “mental disorder” and that he worries for student privacy in restrooms, U.S. District Court Judge Robert Doumar warned Gavin Grimm's attorneys that they now face “an uphill battle."

Grimm, who attends Gloucester High School, argued he must be allowed to use school bathrooms that correspond with his gender identity under Title IX of the Education Act of 1972, which bans discrimination based on sex. Grimm's argument is hardly an exception: The federal government has weighed in repeatedly in recently years — in letters, in court briefs, and to settle complaints — to say Title IX bans transgender discrimination as a form of sex discrimination.

But Doumar announced midway through Monday’s hearing that he was throwing out that argument. “Your case in Title IX is gone, by the way,” he told ACLU staff attorney Joshua Block, who argued on Grimm's behalf. “I have chosen to dismiss Title IX. I decided that before we started.”

The announcement was unexpected not only because it diverges from the recent legal trend on the question of whether sex discrimination bans include anti-transgender discrimination, but also because a lawyer for the U.S. Department of Justice who had come to argue in Grimm’s favor on the Title IX question had not yet been given a chance to speak.

The Justice Department had filed a statement of interest in the case, arguing that Grimm had a right to use the boys restrooms based on Title IX. The Justice Department had also submitted a letter to the court from the Department of Education arguing the same interpretation of Title IX as a general matter.

But Doumar pointed out that Title IX allows segregating single-sex facilities in general, like restrooms and locker rooms, for male and female students. And as such, he appeared to argue, transgender students can be segregated as well based on their birth sex. He suggested birth sex is solely at issue in Title IX, not a person’s chosen gender.

“I have no problem with transgender. I have a lot of problems with sex,” said Doumar. “I am convinced he is a biological female who wants to be a male.”

Grimm's lawyers countered that the Supreme Court used gender and sex interchangeably.

Doumar is letting another one of Grimm’s arguments proceed — a constitutional argument for equal protection. However, Doumar warned Grimm’s lawyers, “[Y]ou have an uphill battle.”

Grimm and his lawyers began climbing that hill in December, when the Gloucester County School Board passed a resolution that restricts single-sex facilities to students with a matching “biological gender.” The policy — apparently aimed specifically at Grimm, the only openly transgender student in the rural Virginia district — also provided three gender-neutral restrooms for students who don’t want to use their assigned single-sex restrooms.

Grimm filed a complaint with the Department of Justice in December, and filed a lawsuit against the school board in June, saying the policy was harmful and stigmatizing.

At Monday’s hearing, two issues were before the court: the school board’s motion to dismiss the case outright and Grimm’s request for an injunction that would allow him to use the boys restroom when he returns to school in September while a trial plays out.

Doumar is unlikely to grant either motion when he issues his decision in writing, he said from the bench on Monday. Doumar said too many issues are unresolved in the school's argument to dismiss the matter wholesale. He added that he likely will let the case proceed to trial.

But he also suggested an injunction, as Grimm sought, was unlikely as well. He was unconvinced that Grimm using the school’s three single-stall unisex restrooms, the nurse’s office restroom, or the girls restroom would cause enough stigma to require immediate intervention.

“I don’t see irreparable harm,” he said, referring to one of the factors courts consider in deciding whether to grant a preliminary injunction.

Block, Grimm’s lawyer, pointed out that Grimm had tried to stop urinating at school altogether to avoid the embarrassment of using the single-stall restrooms, causing a urinary tract infection by holding it. Doumar questioned repeatedly whether it was medically possible to get an infection by holding one's urine.

Arguing for the school board, David Corrigan argued there were no constitutional violations or Title IX violations because Grimm could use the gender-neutral single-stall restrooms or the girls restroom — the restroom that reflects his birth sex. As such, Grimm “is not treated differently than other students,” Corrigan argued.

The school board's arguments leaned heavily on a Pennsylvania case, in which a federal judge dismissed a lawsuit in March filed by a transgender college student who raised similar arguments to those in Grimm’s case. Because it is acceptable to separate male and female restrooms generally, Judge Kim R. Gibson found that a transgender student may be barred from a restroom based on his or her sex at birth.

During Monday's hearing, Doumar raised concerns about the privacy of non-transgender students and the safety of school restrooms. “My biggest problem is with the remainder of the population and of other children,” said Doumar. “I am concerned about the rights of privacy.”

He also repeatedly asserted that being transgender was “a mental disorder.”

The ACLU's Block countered that the Diagnostic and Statistical Manual of Mental Disorders (DSM) states gender dysphoria — the medical term for being transgender — was problematic only if patients could not live in accordance with their gender identity.

“Where did you get your medical degree?” Doumar shot back.

“It is in the DSM,” Block replied.

Dierdre Grimm, Gavin's mother, sat in the second row of benches, lips pursed and occasionally looking away toward the back of the room during arguments. After the hearing, she told BuzzFeed News she admired her son's courage. "Gavin is an amazing person. He knows what he wants, and being his mom is the best job I could have," she said. She declined to comment on the judge.

Outside, Grimm himself reflected on the arguments raised in the courtroom. "I'm a boy. I'm not a girl. I am not unisex."

"I use the male restroom in every other public facility, and it has never been a problem for me."

While the case is certainly about Grimm, the hearing itself was almost as much about Doumar, 84, a Reagan appointee who is known for his courtroom style. Doumar once said that people with HIV who have unprotected sex "should be shot.”

On Monday, Doumar repeatedly interrupted lawyers and waxed on tangents about his frustrations with how the United States is changing. “Where the U.S is going scares me,” he said. “It really scares me.”

When the federal government's lawyer was asked to answer questions toward the end of the hearing, Doumar patronized the Department of Justice for enforcing marijuana prohibition in some states while allowing other states to tax and regulate pot, filing a brief in another unspecific case without pursuing a penalty, and other perceived shortcomings.

“I am sorry for the Department of Justice,” he said. “Sanctuary cities. Where are we going?”

“I get perplexed, very perplexed," he continued. "I believe in the Constitution. … I am worried about where we are going. Maybe I am just old fashioned.” Doumar then went on to cite the works of philosophers Rousseau and Voltaire, saying Congress was too quick to pass new laws.

In his closing words of the hearing on Grimm's restroom use, Doumar’s said, “Oh well, things are changing.”

He slowly walked down from the bench and exited through a door into his chambers.