The U.S. Supreme Court on Tuesday allowed President Donald Trump's ban on transgender troops to go into effect as several cases challenging the policy move forward.

The court sided with the government in a 5-4 order.

In a series of tweets in July 2017, Trump declared that the military will no longer “accept or allow” transgender troops to serve “in any capacity,” reversing Obama-era policy on transgender individuals serving in the military.

LGBT activists filed four lawsuits in federal courts challenging the ban.

After several setbacks in lower courts, the administration modified its policy to allow transgender troops to serve provided they do so as the sex they were assigned at birth.

Lt. Col. Carla Gleason, a Pentagon spokesperson, told CNN in a statement that the Department of Defense's proposed policy is “NOT a ban on service by transgender persons.”

But CNN reported that the court's action means “most transgender persons are now disqualified from military service.”

Steve Vladeck, CNN Supreme Court analyst and professor of law at the University of Texas School of Law, said that Tuesday's action suggests the court will eventually rule in favor of the policy.

“[T]he fact that the Court is allowing the policy to go into effect suggests not only that it will eventually take the case on the merits, but also that five of the justices believe the government is likely to prevail if and when that happens,” he said.

The Human Rights Campaign (HRC), the nation's largest LGBT rights groups, said in a statement that the policy “harms both transgender service members and our national security.”

“As this critical matter makes its way through the courts, brave transgender patriots deserve to have their constitutional rights protected. Today's decision thrusts this administration’s discriminatory agenda onto a military that clearly doesn't want it, and does so at the expense of transgender people's careers and service,” said HRC National Press Secretary Sarah McBride.