The Supreme Court ruled 5-4 today that the Trump administration's policy barring many transgender people from joining the military can take effect while lawsuits challenging the ban are ongoing.

The justices voted along ideological lines. Chief Justice John Roberts, along with Justices Clarence Thomas, Neil Gorsuch, Brett Kavanaugh, and Samuel Alito voted to let the policy take effect. Justices Elena Kagan, Sonia Sotomayor, Ruth Bader Ginsburg, and Stephen Breyer dissented.

President Donald Trump announced the policy via Twitter in July 2017. Transgender people would be barred from serving "in any capacity in the U.S. Military," he tweeted at the time. The announcement represented a reversal of an Obama administration policy that allowed transgender troops to serve openly.

The legal challenges soon followed. As Reason's Scott Shackford documented, various civil rights groups filed suits that the new policy violated the due process and equal protection clauses of the Fifth Amendment. In the midst of those lawsuits, the administration announced a modified policy last March. Under the new ban, transgender people can join and serve in the military as long as they publicly represent themselves by their biological sex and don't have a history of gender dysphoria. Transgender individuals who are already in the military can continue to do so, even if they pursue gender transition.

Implementation of the amended policy, however, had still been blocked by various trial courts around the country, according to The New York Times. But earlier this month, the U.S. Court of Appeals for the District of Columbia Circuit ruled that the policy should not have been blocked by one of those courts because it was not a "blanket ban."

"The government took substantial steps to cure the procedural deficiencies the court identified in the enjoined 2017 presidential memorandum," the appeals court said at the time, according to USA Today, adding that the ban "appears to permit some transgender individuals to serve in the military."

The Supreme Court's decision today addresses two other injunctions against the ban issued by district court judges in California and Washington State, the Times reported.

The policy can now be implemented pending a ruling on the ban's constitutionality from the U.S. Court of Appeals for the Ninth Circuit, the Supreme Court said. "If a writ of certiorari [following that ruling] is sought and the Court denies the petition, this order shall terminate automatically," the ruling reads. "If the Court grants the petition for a writ of certiorari, this order shall terminate when the Court enters its judgement."