Updated

The Democratic-controlled House voted Tuesday night to block President Donald Trump's move to restrict transgender men and women from military service.

The House passed, by a 243-183 vote, an amendment to block Trump's transgender ban from remaining in effect. The move still faces an uphill battle and a Trump veto threat against the underlying $1 trillion spending bill, which includes the military budget.

The Trump administration's policy bars people who have undergone gender transition from enlisting. It also requires military personnel to serve as their biological gender unless they began a gender transition under less restrictive Obama administration rules. The policy is being challenged in court.

"With so much anger and so much hate in the world today, it is time to be kind to people," said Rep. Peter Visclosky, D-Ind.

A GOP opponent, Rep. Ken Calvert of California, said the move "risks undermining the readiness of our military at a time when we can least afford it."

But Rep. Anthony Brown, D-Md., said such arguments were used to justify segregation of the military.

"My service in an integrated armed forces did not harm readiness," said Brown, who is African American.

Under the Obama administration, the Pentagon announced that transgender people already serving in the military would be allowed to serve openly. Trump reversed that policy beginning in 2017 with a tweet that the government would not allow transgender individuals to serve in any capacity in the military.

An estimated 14,700 troops on active duty and in the reserves identify as transgender, but not all seek treatment. Since July 2016, more than 1,500 service members have been diagnosed with gender dysphoria; as of Feb. 1, there were 1,071 currently serving. The Pentagon says it has spent about $8 million on transgender care since 2016. The military's annual health care budget tops $50 billion.

All four service chiefs told Congress last year that they had seen no discipline, morale or unit readiness problems with transgender troops serving openly in the military. But they also acknowledged that some commanders were spending a lot of time with transgender individuals who were working through medical requirements and other transition issues.