WASHINGTON (Reuters) - The House of Representatives voted overwhelmingly on Tuesday to tighten restrictions on travel to the United States by citizens of 38 nations who are allowed to enter the country without obtaining a visa.

Newly elected Speaker of the U.S. House of Representatives Paul Ryan (R-WI) (C) speaks to the assembled House after being elected as the new Speaker in Washington October 29, 2015. REUTERS/Gary Cameron

The bill, the second major piece of security legislation approved in the chamber in response to the Nov. 13 Paris attacks, passed by 407 to 19.

The measure would require visitors from the visa waiver countries, which include much of western Europe, to obtain a visa to travel to the United States if they had been to Syria, Iraq, Iran or Sudan during the past five years.

It would also require countries participating in the program to share information with U.S. authorities about suspected terrorists or risk being suspended from the scheme.

“This legislation will help close gaping security gaps and improve our ability to stop dangerous individuals before they reach our shores,” said Republican Representative Michael McCaul, the House Homeland Security Committee chairman.

Twenty million visitors a year enter the United States under the program, which allows them to stay 90 days. It was started in 1986 to boost tourism and tighten the country’s relationship with close allies.

Congress has been focused on visa waivers since Paris because some of the militants behind the attacks were Europeans radicalized after visiting Syria.

The U.S. Travel Association backed the House bill, rather than a Senate proposal from Democrat Dianne Feinstein and Republican Jeff Flake that would also require the collection of biometric data. The industry group says that could discourage legitimate travelers from visiting the country.

Backing for the other security bill passed in the House, tightening screening of refugees from Syria and Iraq, was far more partisan. Just 47 Democrats joined 242 Republicans who voted for it and President Barack Obama, a Democrat, promised a veto.

Debate about border controls has grown more acrimonious since last week’s attacks in San Bernardino, Calif., by a Muslim couple. Republican presidential candidate Donald Trump proposed banning Muslims from entering the United States, remarks that drew international condemnation.

The Senate has not scheduled a vote on either measure. Both could be included in a trillion-dollar spending bill that Congress must pass in the next few days in order to keep the government open.

Obama called on Congress to tighten the visa waiver program in a national security speech to the nation on Sunday night.