House Majority Leader Steny Hoyer of Maryland, left, accompanied by Rep. Jimmy Panetta, D-California, center, and Rep. Chrissy Houlahan, D-Pennsylvania, right, speaks at a news conference to introduce legislation supporting NATO on Capitol Hill in Washington on Tuesday. Credit: Andrew Harnik | AP

WASHINGTON — The House of Representatives resoundingly passed a bipartisan measure Tuesday to prohibit the Trump administration from using federal funds to pull the United States out of NATO, rebuking the president for his frequent attacks against the strategic alliance and suggesting he might seek to withdraw.

The vast majority of House Republicans joined Democrats to pass the bill by a vote of 357 to 22, after members of both parties gave impassioned speeches for why the alliance was so vital to preserve and protect.

“Time and again the alliance has proven that the free peoples of the world are strongest when they stand together,” said Rep. Mike McCaul of Texas, the ranking Republican on the House Foreign Affairs Committee. He called the alliance “a bulwark against international terror” and “critical to our national security, and to the preservation of our military prowess around the world.”

“The mutual defense pledge is why NATO has been the most successful alliance in military history,” bill sponsor Rep. Jimmy Panetta, D-California, said. “Moscow never went to war with a NATO power. We got bases and a guarantee that we would never have to fight alone … and everybody on the European continent got stability and peace to strengthen our democracies.”

Yet members of the two parties differed in how sharply they were willing to directly chide Trump as they voiced support for the measure.

The bill endorses the 2014 Wales Defense Investment Pledge, under which NATO countries said they would endeavor “to reverse the trend of declining defense budgets” and ensure that every member spends 2 percent of their national income on defense capabilities that could be called upon in support of NATO.

Trump has frequently mischaracterized the pledge, alleging NATO members “owe” the United States and have been “delinquent” for years.

House Republicans backing Tuesday’s measure pointed to the bill’s support for the 2014 declaration — and the subsequent efforts of NATO countries to ratchet up their defense spending — as a positive, without directly addressing the president’s claims.

But Democrats were more blunt about framing their support for the measure as a rejection of Trump’s stance — and a warning to him not to escalate his political standoff with NATO any further.

“We can continue to put pressure on our NATO partners to pay their 2 percent of their GDP, but that doesn’t mean that we want to get out of NATO,” Panetta said. “NATO is not a transactional relationship, our sole focus cannot be on who pays and who gets what. Being a part of NATO is not like being a part of a country club.”