Defense secretary James Mattis announced on Tuesday that transgender troops would be allowed to continue serving in the US military pending the results of a study.

The announcement followed Donald Trump’s controversial decision to ban transgender individuals from enlisting in the military, which was first unveiled by the president in a series of tweets last month. In a memo last week, Trump formally reversed a policy under the Obama administration that paved the way for transgender people to enlist. He also directed Mattis to examine how best to deal with trans troops already serving in the military.

Mattis said in a statement that he would set up a panel of experts to provide recommendations on implementing the ban.

Mattis said: “Once the panel reports its recommendations and following my consultation with the secretary of Homeland Security, I will provide my advice to the president concerning implementation of his policy direction. In the interim, current policy with respect to currently serving members will remain in place.”

He added: “Our focus must always be on what is best for the military’s combat effectiveness leading to victory on the battlefield.

A 2016 study by the Rand corporation, which was commissioned by the Pentagon under the Obama administration, estimated there are up to 6,630 trans people on active duty and as many as 4,160 in the select reserve.

Prior to Trump’s policy change, the Pentagon had delayed a deadline set by the Obama administration of 1 July 2017 to determine whether incoming recruits who openly identified as trans could enlist. The six-month delay had been negotiated by Mattis after consultation with the chiefs of the army, navy, air force and marine corps. There was no public indication that any of the joint chiefs believed a ban was necessary.

Trump nonetheless abruptly tweeted his intention to ban transgender service members in late July, without notifying the Pentagon in advance. Mattis, who has managed to keep a distance from Trump’s more divisive moves, was on vacation at the time. The memo signed by Trump last week not only directed Mattis to bar trans people from enlisting, but also gave the defense secretary the power to discharge those already serving.

Trump’s action drew widespread condemnation from civil rights advocates and Democrats. Some Republicans in Congress also expressed their disagreement. The American Civil Liberties Union (ACLU) on Monday filed a lawsuit in federal court, saying the policy was rooted in “discredited myths” and was in violation of the US constitution.

The Rand study found that medical care for individuals who transition would cost roughly $2.4 to $4m annually, thus amounting to no more than 0.13% of spending on healthcare for active duty armed service members.

Reuters contributed reporting