Attorney General Jeff Sessions has reversed a three-year-old Justice Department policy that protected transgender workers from discrimination under federal law.

In a memo to his U.S. attorney offices and agency heads, Sessions said that Title VII of the Civil Rights Act of 1964 does not protect transgender people from workplace discrimination by private employers and state and local governments.

"Title VII's prohibition on sex discrimination encompasses discrimination between men and women but does not encompass discrimination based on gender identity per se, including transgender status," Sessions wrote in the memo dated Wednesday.

The attorney general's memo says the Justice Department will take this position "in all pending and future matters," indicating his policy will have a wide-ranging effect.

Civil rights groups quickly lashed out at Sessions and accused him of "yet another rollback of protections for LGBTQ people."

"Today's announcement is the latest example of how the Trump administration and the Sessions Justice Department are undermining equal rights and dignity for lesbian, gay, bisexual and transgender individuals," said Vanita Gupta, who was head of the Civil Rights Division in the Obama administration and is now president and chief executive of the Leadership Conference on Civil and Human Rights.

Justice spokesman Devin M. O'Malley said Sessions changed the policy because the previous administration had not accurately interpreted the civil rights law.

"The Justice Department cannot expand the law beyond what Congress has provided," O'Malley said. "Unfortunately, the last administration abandoned that fundamental principle, which necessitated today's action." Sessions's memo was first reported by BuzzFeed.

Sessions's memo was released on the same day the Justice Department asked a federal court to dismiss a lawsuit seeking to block President Trump's proposed ban on transgender people serving in the military.

In their federal court filing, Justice lawyers called the lawsuit "premature several times over."

The lawsuit was filed in Washington by two gay rights organizations representing eight transgender U.S. service members. The Justice Department said the lawsuit is asking U.S. District Judge Colleen Kollar-Kotelly of the District "to prejudge the constitutionality of a future Government policy" that has not been drafted.

The groups that sought an injunction said that even though Defense Secretary Jim Mattis has not taken action against service members as the Pentagon reviews its options, he committed in an August guidance document to carrying out the Trump policy by March 23. As a result, service members face the imminent prospect of being denied reenlistment, promotions, deployments and even medical care, the groups said.

"No actual discharge or denial of accession has occurred, and they will not suffer a hardship if the Court withholds consideration until after the policies challenged in this case are implemented and are found to impact Plaintiffs," Ryan B. Parker and Andrew E. Carmichael wrote for the Justice Department's civil division.

As for two named plaintiffs, Regan Kibby, who is a midshipman at the U.S. Naval Academy, and Dylan Kohere, an Army Reserve Officers' Training Corps cadet, the Justice Department claimed that despite the threat to their future enlistment, neither will be set to apply for officer's commissions until they complete studies in 2020 at the earliest.

The government's 44-page filing before a midnight deadline did not argue the merits of a ban, but argued on procedural grounds that the court has no jurisdiction yet to act.

In response, the suing groups, the National Center for Lesbian Rights and GLBTQ Legal Advocates & Defenders (GLAD), called it a "fantasy" that Trump's tweeted announcement July 26 that the government "will not accept or allow Transgender individuals to serve in any capacity in the U.S. Military," followed by an Aug. 25 presidential memorandum, has not affected thousands of service members and their families.

In court filings, the suing groups said two plaintiffs have been informed that they cannot undergo "urgently needed surgeries," another has been unable to reenlist for two more years to meet her 20-year mark, and Kohere's ROTC commander barred him from participating in the program, for example.

"The government's response reads like pure fiction," said Jennifer Levi, director of GLAD's Transgender Rights Project. "Every day this reckless ban stays in place, our military strength is diminished and our country is less safe for it. We are optimistic the court will see through this smokescreen and halt the ban."

The ban has left "real people and real families . . . scrambling to make new plans for their futures, just as it has undermined our nation's security. This is the exact opposite of how military policy should be made," Shannon Minter, NCLR's legal director, added in a statement.

The ban would reverse an Obama administration decision to allow transgender people to serve openly. The armed forces were set to begin enlisting transgender people July 1, but Mattis suspended that move, while announcing in September that current enlistees will be allowed to continue serving, pending the results of a study and recommendations by a panel of experts.

Before the Obama policy change, the Pentagon had concluded that there was no basis for the military to exclude transgender people, as long as they could meet the same fitness requirements as other service members. The review examined medical care, military readiness and other factors.

There is no official tally of transgender military members, and estimates vary widely. One recent study by the Rand Corp. put the number on active duty at about 2,500, while another from the Williams Institute at UCLA Law School estimated that there were 15,500 on active duty, in the National Guard and in the reserves.