A bipartisan group of House lawmakers introduced a bill Friday that would block President Trump from imposing a ban on service by transgender troops.

The bill, sponsored by Rep. Jackie Speier, D-Calif., prohibits the Defense Department and Coast Guard from ruling out service based on gender identity, mirroring a bipartisan Senate bill introduced by Sen. John McCain, R-Ariz., and others in September.

Trump has ordered the military to halt plans to recruit transgender troops, stop providing coverage of gender transition surgeries by March and come up with a plan by February to deal with currently serving transgender troops, who could number in the hundreds or even thousands.

"News flash, Mr. President — thousands of transgender troops already serve our country with pride and dignity," Speier said in a released statement. "Our military should be focused on recruiting and retaining the best troops, not on rejecting qualified service members on the basis of discrimination."

The House bill is co-sponsored by Rep. Adam Smith, the ranking member on the Armed Services Committee, and fellow Democrats Susan Davis of California and Kyrsten Sinema of Arizona. Republican Reps. Charlie Dent, a Pennsylvania moderate, and Ileana Ros-Lehtinen of Florida, who has a transgender son, also signed onto the legislation.

It drew cheers from transgender rights groups that have strongly opposed Trump's effort to roll back open transgender service implemented by the Obama administration a year ago.

"Bipartisan congressional support for the troops reflects the broad agreement among security leaders and the public that Americans who are able and willing to serve should be allowed to do so, and that uniformed service should be based on merit not politics or emotion," said Aaron Belkin, director of the Palm Center.

In his August order, Trump said the previous administration did not make the case that transgender service would not hamper the military's ability to fight. He also cited cost and disruption in a series of surprise tweets announcing the new policy in July.

The Senate legislation was spearheaded by Sens. Kirsten Gillibrand, D-N.Y., and Susan Collins, R-Maine, who had hoped to add it to a must-pass annual defense policy bill.

But when the defense bill amendment process broke down amid partisan infighting, they struck a deal with McCain that he would back a stand-alone transgender service bill.

"When less than one percent of Americans are volunteering to join the military, we should welcome all those who are willing and able to serve our country," McCain said at the time.