President Trump on Friday ordered the Pentagon to drop plans to recruit transgender troops, halt their medical treatment and determine within six months whether those currently serving can remain in the military.

The president's memorandum follows his series of tweets last month declaring transgender troops would no longer be allowed to serve in any capacity and is aimed at rolling back the Obama administration's policy of open transgender service implemented last year for the Defense Department and Coast Guard, which is part of the Department of Homeland Security, a senior White House official said.

"In President Trump's judgment, the previous administration failed to identify a sufficient basis to conclude that terminating the DOD and DHS long-standing policy and practice would not hinder military effectiveness or lethality, disrupt unit cohesion, tax military resources, etc.," said the official, who briefed reporters on the memorandum.

The new personnel policy has already triggered a lawsuit by five transgender service members against Trump and top administration officials as well as outrage from Democrats and transgender advocates who have called it a "purge" of honorably serving troops for political reasons.

Defense Secretary Jim Mattis is required to implement Trump's new transgender guidelines by March 23. Mattis and the Defense Department's legal counsel had been briefed on the drafting of the memorandum in recent weeks, the White House official said.

"The Department of Defense has received formal guidance from the White House in reference to transgender personnel serving in the military," Mattis spokeswoman Dana White said in a released statement. "More information will be forthcoming."

But White House would not say whether the memorandum could allow some current transgender troops to remain. It gives Mattis and the Coast Guard authority to determine the ultimate status of the hundreds or thousands of currently serving transgender service members over the next six months.

"It identifies a number of factors to be considered, things like military effectiveness, lethality, unit cohesion, military resources, etc., but then indicates that it is up to [the Defense Department], and with respect to the Coast Guard [the Department of Homeland Security], to determine how to address transgender individuals currently serving," the official said.

It remains unclear how many transgender troops are currently serving. A Rand Corporation study in 2016 found the number could be 1,300 to 6,600 but some advocate groups have estimated numbers are high as 15,000.

The White House directed questions about the cost of medical treatment -- a point made by Trump in his original tweets and an argument by conservative Republicans -- to the Defense Department. The Rand study estimated it could cost the department about $2 million to $8 million per year, about a .13 percent increase in total military healthcare costs.