The judge, Colleen Kollar-Kotelly, issued a preliminary injunction on Monday halting two portions of Trump's presidential memorandum issued in late August, including his reinstatement of the ban on transgender service members that was in place before June 2016.
Kollar-Kotelly also temporarily stopped Trump's move to block recruiting openly transgender people for the military.
However, she did not block the portion of the memo directing that government funds may not be used for sex reassignment procedures.
Kollar-Kotelly was ruling on a lawsuit, Jane Doe v. Donald Trump, brought by several active-duty transgender service members to stop the implementation of the ban.
Gen. Joseph Dunford, the chairman of the Joint Chiefs of Staff, issued a statement after those tweets, announcing that no immediate personnel decisions would be made until after a formal presidential memorandum was issued.
The memo, provided in late August, gives the Department of Defense until March 23 of next year to develop and implement a compliance plan.
"In my judgment, the previous administration failed to identify a sufficient basis to conclude that terminating the departments' long-standing policy and practice would not hinder military effectiveness and lethality, disrupt unit cohesion or tax military resources, and there remain meaningful concerns that further study is needed to ensure that continued implementation of last year's policy change would not have those negative effects," Trump's memo reads.
"For questions regarding the specifics of today's court ruling, I would refer you to the Department of Justice," said Maj. Dave Eastburn, a Pentagon spokesperson.
However, this June, Trump's Defense Secretary Jim Mattis extended that study through January 2018. The White House memo would have extended the ban indefinitely until "such time that the defense secretary recommends against the contrary," the official said.