Civil rights groups on Saturday announced their intent to file suit against Donald Trump’s “mean-spirited and discriminatory” attempt to ban transgender people from serving in the US armed forces.

Trump announced the ban on Twitter in July. Top US military leaders have not implemented it, since no formal guidance was provided.

But after a report published late on Friday said the White House had approved guidance on the ban, Lambda Legal and OutServe-Servicemembers Legal Defense Network (Outserve-SLDN) announced an intent to file suit.

Sasha Buchert, a Lambda Legal staff attorney and transgender military veteran, said the ban was “capricious, irrational and clearly driven by anti-LGBT forces in the administration who care more about harming transgender people than keeping our nation safe”.

“The safety of all service members – transgender or not – is undermined by a policy like this that distracts from the important missions they have for no valid reason,” Buchert wrote in a blogpost.

“It is also a slap in the face of the leadership who have worked diligently to develop and implement the current policy which has been in place for more than a year without incident.”

On 26 July, just over a year after the US defense department announced an end to its transgender ban, Trump used Twitter to say he would reinstate it.

“Our military must be focused on decisive and overwhelming … victory and cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail,” he wrote.

There is no official count of transgender service members, but OutServe-SLDN estimates the number at about 15,500. Before a ban on their service was struck down, such service members could be involuntarily separated, discharged or denied reenlistment or continuation of service, just for being transgender.

Shortly after Trump’s tweeted announcement, civil liberties groups including Lambda, OutServe-SLDN and the American Civil Liberties Union vowed to file suit once the ban took effect.

On Friday night, the Washington Blade, an LGBT news site, reported that the president and White House counsel had approved formal guidance for the ban and were preparing to deliver it to the Department of Defense.

Sources told the site a policy titled “A Guidance Policy for Open Transgender Service Phase Out” would allow transgender service members to continue serving but would not protect them from harassment and would encourage them to retire early.

Jon Davidson, legal director at Lambda Legal, said in an emailed statement the suit would be filed “very soon” and would challenge the policy under the equal protection and due process clauses of the constitution.

“Further details will be forthcoming but we are not yet ready to disclose whom we are suing on behalf of, the named defendants or precisely when or where we will be filing,” Davidson said.

The proposed ban has been condemned by LGBT advocates as well as 56 retired generals and admirals who warned that the discriminatory policy would degrade military readiness and harm morale.

The retired generals and admirals said Trump’s ban would cause “significant disruptions, deprive the military of mission-critical talent, and compromise the integrity of transgender troops who would be forced to live a lie, as well as non-transgender peers who would be forced to choose between reporting their comrades or disobeying policy”.