Image copyright Reuters Image caption People protest President Trump's announcement of plans to reinstate a ban on transgender individuals from serving

The United States Supreme Court has allowed President Donald Trump to enforce his policy of banning certain transgender people from the military.

The court voted 5-4 to grant a Trump administration request to lift injunctions blocking the policy while challenges continue in lower courts.

The four liberal judges on the court opposed the ruling.

The policy prohibits "transgender persons who require or have undergone gender transition" from serving.

The top court's ruling is not a mandate, but it has opened up the option for the military to enforce the ban.

The Trump administration had also appealed for an expedited ruling on the case, which the Supreme Court declined to take up.

What is the transgender policy?

The president announced on Twitter in 2017 that the country would no longer "accept or allow" transgender Americans to serve in the military, citing "tremendous medical costs and disruption".

The then defence secretary Jim Mattis refined the policy to limit it to individuals with a history of gender dysphoria, or when a person's biological sex and identity does not match.

He said the new policy would make exceptions for several hundred transgender people already serving openly or willing to serve "in their biological sex".

There are currently some 8,980 active duty transgender troops, according to Department of Defence data analysed by the Palm Center, a public policy nonprofit.

Gen Mattis in his memo argued that "by its very nature, military service requires sacrifice," and that those who serve "voluntarily accept limitations on their personal liberties".

The move is a reversal of an Obama administration policy that ruled transgender Americans could serve openly in the military as well as obtain funding for gender re-assignment surgery.

Aaron Belkin, director of the Palm Center, told the BBC: "We had an inclusive policy for almost three years. What today's ruling enables is the whipsawing of policy, back and forth."

Media playback is unsupported on your device Media caption Riley Dosh explains why she wants to defend her country

The battle continues

This is just one Supreme Court action - and it's a procedural move, not a formal court opinion - but it may be a sign that a conservative majority sympathetic to presidential powers and prerogatives is flexing its muscles.

The Trump administration, frustrated that lower-court judges had again blocked implementation of one of its policy decisions, asked the justices to step in and clear the path.

The White House wanted a quick ruling because, it said, allowing transgender individuals to serve in the military presented "too great a risk to military effectiveness".

By a bare majority, the court complied.

Although the justices did not entirely bypass the Ninth Circuit Court of Appeals, which the president has tried to paint as a bastion of liberal judges, they did the next best thing for the president.

They permitted the transgender ban to go into effect while the legal fight, which could last years, grinds on.

For the past two years, the president's opponents - locked out of national power until recently - have looked to the judicial system as a last line of defence.

As Tuesday clearly showed, however, those defences are only as strong as a majority of the Supreme Court says they are.

Media playback is unsupported on your device Media caption Being transgender in the US military

What are the legal challenges?

Several trial judges around the country had issued injunctions blocking the ban.

One injunction was reversed in a federal appeals court earlier this month, with a three-judge panel ruling the policy was not a "blanket ban" on transgender troops, and so the courts should defer to the executive branch's military decisions.

While Mr Trump's rationale for banning transgender troops was financial, according to estimates by the RAND Corporation, a policy think tank working with the US Armed Forces, transition-related healthcare costs are between $2.4m (£1.8m) and $8.4m per year.

In 2017, defence data viewed by the Palm Center indicates that cost was in fact lower, at $2.2m.

Solicitor General Noel Francisco had described the transgender ban in his fast-track appeal as "an issue of imperative public importance" regarding the military's authority "to determine who may serve".

Mr Belkin told the BBC: "This is not a financial issue, it's not a disruption issue - it's an issue of emotion, tolerance and politics."

The Supreme Court "had no business weighing in" at this point, he added.

"Not only is there no policy emergency, but there is not even a policy problem."

Image copyright Pacific Press via Getty Images Image caption A group of New Yorkers gathered in 2017 at the Trump International Hotel to protest against LGBT-discrimination

What is reaction?

Pentagon spokeswoman Lt Col Carla Gleason said in a statement that the military treats "all transgender persons with respect and dignity" and the new policy was "based on professional military judgement".

She said the "proposed policy is NOT a ban on service by transgender persons. It is critical that [the defence department] be permitted to implement personnel policies that it determines are necessary to ensure the most lethal and combat effective fighting force in the world."

Department of Justice spokeswoman Kerri Kupec said the administration was "pleased" that the top court was "clearing the way for the policy to go into effect".

"Our military had been forced to maintain a prior policy that poses a risk to military effectiveness and lethality for over a year."

The top court's ruling has sparked outrage and frustration online.

Charlotte Clymer, a transgender Army veteran, tweeted: "This is a hateful and cowardly policy."

Others, however, said the ban just meant transgender troops must "conform to dress code/physical standards like everyone else".