The House voted overwhelmingly Tuesday night to block President Trump from spending any federal money to withdraw from NATO and to set a formal policy that the U.S. will "remain a member in good standing."

“This branch of government fully supports the alliance, the collective defense of our allies, and peace across the North Atlantic region,” House Foreign Affairs Chairman Eliot Engel, D-N.Y., said during a floor debate.

The bill passed easily in a 357-22 vote — all the "no" votes came from Republicans.

Rep. Jimmy Panetta, D-Calif., introduced the NATO Support Act last week, just days after a New York Times report said President Trump has “privately said he wanted to withdraw from the North Atlantic Treaty Organization.”

The legislation reiterates the support of Congress for NATO and denounces any effort to withdraw or “indirectly withdraw” through a cut in U.S. commitments to the alliance. It would also deny funding to implement such a decision by the president.

“NATO is our greatest strategic advantage, one built over time and at great sacrifice,” Engel said. “We simply cannot cede such an advantage. Past and future generations alike would never forgive the squandering of something so precious.”

President Trump has jolted Western allies with his various criticisms of the alliance, dating back to the campaign trail when he told reporters that NATO members couldn’t assume that the United States would defend them from an attack.

“If they fulfill their obligations to us, the answer is yes,” he said. He didn’t endorse Article V of the treaty — the provision that establishes that NATO members will defend each other if attacked — until the following year.

“Certainly, we are there to protect,” Trump said in June of 2017.

Panetta, the bill’s author, faulted Trump for seeding such misgivings.

"The mutual defense pledge is why NATO has been the most successful military alliance in history,” he said. “It is an interdependency that has stood as a sturdy, strong, and sound anchor for peace that has prevented new world wars, fostered western prosperity, and advanced democratic governance.”

Trump’s administration has argued that his policies, especially the insistence on increased defense spending by European nations, has fortified the alliance, not weakened it.

“We’ve rebuilt NATO in important ways already,” Secretary of State Mike Pompeo told reporters after his trip to the NATO Foreign Minister summit in December. “NATO is a far stronger organization as a result of the Trump administration than it was for the previous decade, I can assure you. And the 28 European ministers who were there with me today know that too.”

The top Republican on the Foreign Affairs Committee backed Panetta’s effort, but he echoed the president’s critique of European allies.

“An alliance of mutual defense is only as strong as each country's commitment to its spending goals,” Texas Rep. Michael McCaul, the ranking member on the Foreign Affairs Committee, said on the floor. “Statements of support like this bill are important in affirming our relationships around the world. But actions speak louder than words. No statement about the importance of NATO speaks as loudly as a tangible commitment each country makes to ensuring the strength of the alliance.”

Panetta also called for spending increases, but sharpened the rebuke of Trump.

“NATO is not — is not — a transactional relationship,” the California Democrat said. “Our sole focus can’t just be on who pays and who gets what. Being a part of NATO is not like being a part of a country club ... NATO is instrumental from setting us apart from Russia. Why? We have allies who will stand by us. Russia doesn't."