President Donald Trump's controversial ban on transgender military troops has become official at the Pentagon.

The policy will require transgender people currently serving in the military to follow the standards that match their birth gender, Reuters reported. Those who are unwilling could be discharged, according to the policy signed by Deputy Defense Secretary David Norquist late Tuesday.

The policy comes after a lengthy court battle over President Trump's order in July 2017 to ban all transgender persons from serving in the military.

What's the background?

In January, the Supreme Court cleared the way for the administration's ban. The justices voted 5-4 to allow the barring of transgender persons from serving while litigation against the policy played out in the lower courts.

"We are pleased the Supreme Court granted stays in these cases, clearing the way for the policy to go into effect while litigation continues," Justice Department spokeswoman Kerri Kupec told Bloomberg. "Due to lower courts issuing nationwide injunctions, our military had been forced to maintain a prior policy that poses a risk to military effectiveness and lethality for over a year."

In 2016, former President Barack Obama lifted a longstanding policy that prohibited transgender persons from serving. Since that time, transgender persons have openly served. After Trump took office, he began the process of rolling back the policy, which was met by multiple injunctions.

Last week, U.S. District Judge George Russell III lifted the final injunction against the Pentagon's policy that banned most transgender persons from serving in the military, the Washington Examiner reported.

It was the last of four injunctions on the Trump administration's ban.

The new policy is set to go into effect April 12, which would allow current service members time to qualify for gender transition. Waivers may be issued on a case-by-case basis from service secretaries.

What are the details?

The ban requires transgender service members who want to continue their service to meet the dress and grooming standards that coordinate with their biological sex, according to the memo obtained by ABC News.

Those who are already enlisted or had signed their enlistment contracts by April 12, would be allowed to continue hormone treatments and gender transition if they've been diagnosed with gender dysphoria.

Service members who are diagnosed with gender dysphoria after April 12 would be required to serve as their birth gender and they would be banned from transitioning while serving.

Can transgender persons who've transitioned join?

Transgender persons who have already transitioned to a new gender would not be allowed to join the military once the new policy is in effect.

Only those who have never had hormone treatment or surgery would be allowed to enter the military.

What do Democrats say?

Democratic House Speaker Nancy Pelosi (Calif.) slammed the president and his administration's policy in a statement late Tuesday.

"The President's revival of his bigoted, disgusting ban on transgender service members is a stunning attack on the patriots who keep us safe and on the most fundamental ideals of our nation," Pelosi wrote.

"The President's years-long insistence on his cowardly ban makes clear that prejudice, not patriotism, guides his decisions. If implemented, this hateful policy would undermine our military readiness and betray our core American values," Pelosi continued. "No one with the strength and bravery to serve in the U.S. military should be turned away because of who they are. The House will continue to fight this discriminatory action, which has no place in our country. We will never allow hate and prejudice to dictate our national security."

At a hearing last month, five transgender troops testified before Congress about their transitioning. The service members claimed that their sex changes made them more effective.

Rep. Jackie Speier (D-Calif.) said that banning transgender persons from joining the service "would cost us recruits at a time when so few Americans are willing to serve," ABC News reported.

How many transgender troops are currently serving?

There are an estimated 14,700 troops who currently are serving in the military and identify as transgender, Military Times reported. More than 1,500 have been diagnosed with gender dysphoria since July 2016.

The military has spent an estimated $8 million on transgender health care since 2016, according to the Pentagon.