A federal judge in Los Angeles Friday issued the fourth nationwide preliminary injunction halting President Donald Trump's attempt to ban transgender individuals from openly serving in the military while it is challenged in the courts.

Federal District Judge Jesus G. Bernal ruled the ban was discriminatory and unlawful.

The suit was filed by seven transgender individuals either serving in the armed forces or intending to enlist and the lesbian, gay, bisexual transgender and questioning civil rights organization Equality California.

California is a co-plaintiff in the case filed in the Central District of California. Federal courts in Maryland, Washington and the District of Columbia previously issued injunctions against the ban.

"Discriminating against capable soldiers because of their gender identity does not represent the values of our great nation," California Attorney General Xavier Becerra said. "We are pleased that today's ruling proves that discrimination against transgender Americans will not be tolerated.

"The president's disgraceful ban on transgender people serving in the military not only compromises our national security, but it marginalizes transgender Americans who are willing to sacrifice everything to keep us safe. We are proud to be part of the fight to protect the rights of this honorable group of brave people defending our country."

In a series of tweets July 26, Trump wrote that "After consultation with my Generals and military experts, please be advised that the United States Government will not accept or allow transgender individuals to serve in any capacity in the U.S. Military. 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."

Trump issued a memorandum in August, extending the policy prohibiting transgender individuals from serving openly in the military beyond Jan. 1. Rick Zbur, Equality California's executive director, said in September the costs to the government of transition-related care would be negligible.