WASHINGTON (Reuters) - In a warning to President Donald Trump not to try to withdraw the United States from the NATO military alliance, the U.S. House of Representatives on Tuesday approved legislation aimed at preventing such a move.

U.S. and Polish soldiers take part in NATO military defence exercise Anakonda 2018, at military range near Drawsko Pomorskie, Poland, November 16, 2018. Cezary Aszkielowicz/Agencja Gazeta via REUTERS

The Democratic-led House approved the measure by a bipartisan 357-22 vote, with the only “no” votes coming from Republicans. It now goes to the Republican-majority Senate, where its future is unclear, although a similar measure has been introduced there.

At a news conference before the vote, Democratic lawmakers said they were alarmed by reports of the Republican president’s low regard for the North Atlantic Treaty Organization, a 70-year-old military alliance that joins the United States and Canada with allies in Europe.

The New York Times said last week that several times over the course of 2018, Trump privately told his advisers he wanted to withdraw from NATO.

Publicly, the president has rebuked NATO allies for spending too little on defense.

The legislation that passed the House Tuesday reaffirms lawmakers’ support for NATO, and says no U.S. funds will be spent to withdraw the United States from it.

“This bill ... makes it clear that the United States Congress still believes (in) the NATO mission and will prevent any short-sighted efforts to undermine NATO or unilaterally withdraw our country,” House Majority Leader Steny Hoyer, a Democrat, said.

“It is in a sense crazy that we have to be doing this,” added freshman Democratic Representative Tom Malinowski, a former assistant secretary at the State Department.

“I take the President of the United States seriously. He has made no secret of his disdain for the NATO alliance and his willingness to consider leaving it ... Congress is now the only check we have,” Malinowski said.

Last week a bipartisan bill was introduced in the Senate to prohibit any U.S. president from withdrawing from NATO without Senate approval.