BALTIMORE (AP) — The American Civil Liberties Union has filed a lawsuit challenging President Donald Trump’s ban on transgender individuals joining the military.

The federal lawsuit, Stone v. Trump, was filed in Maryland on Monday by the ACLU of Maryland on behalf of Petty Officer First Class Brock Stone, an 11-year Navy veteran who served in Afghanistan, and several other transgender members of the Navy, Army, Air Force and Marines.

Trump directed the Pentagon on Friday to implement the ban on transgender individuals joining the military, which he first announced in a tweet. He also gave to the Pentagon the authority to decide the future of openly transgender people already serving.

The lawsuit says Trump’s policy violates the equal protection rights of transgender service members who now have “grave reason to fear for their careers.”

The lawsuit questions the premise for the ban cited in the president’s tweets. Trump wrote that he made his decision after consulting with “my Generals and military experts,” saying they “cannot be burdened with the tremendous medical costs and disruption that transgender in the military would entail.”

But the lawsuit says news reports indicate top “military officials were surprised by Trump’s announcement, and that his actual motivations were purely political, reflecting a desire to accommodate legislators and advisers who bear animus and moral disapproval toward men and women who are transgender, with a goal of gaining votes for a spending bill that included money to build a border wall with Mexico.”