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

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

Among other things, 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.

RELATED: Trump says he would raise visa fees to pay for Mexican border wall and deport undocumented immigrants

It also would also require countries participating in the program to share information with U.S. authorities about suspected terrorists.

"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, chairman of the House Homeland Security Committee.

About 20 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 its closest allies.

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

RELATED: NYC stands to lose $150M in services, 1,000 city jobs with latest GOP sanctuary city bill

Debate about border controls has grown more acrimonious since last week's attacks in San Bernardino, Calif., by a Muslim couple who pledged allegiance to the Islamic State. Republican presidential candidate Donald Trump proposed that Muslims be banned from entering the United States, remarks that drew international condemnation.

The Senate has not scheduled a vote on either measure, and 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.

The White House has expressed support for tightening the visa waiver program.