WASHINGTON - Driven by the Paris attacks, the House voted overwhelmingly Tuesday to tighten controls on travel to the United States and require visas for anyone who has been in Iraq or Syria in the previous five years.

The legislation takes aim at the "visa waiver" program that lets citizens of 38 countries travel to the U.S. for stays of up to 90 days without first obtaining a visa from an embassy or consulate. Belgium and France, home to most of the perpetrators of last month's Paris attacks, are among the participating countries.

The bill, which passed, 407-19, would institute a series of changes, including the new visa requirement for citizens of Iraq, Syria, and any other country deemed a terrorist hot spot, along with anyone who has traveled to those countries in the previous five years. Exceptions are made for official government visits and military service.

All House members from the Philadelphia area backed the bill.

Countries in the visa-waiver program would also be required to share counterterror information with the U.S. or face expulsion from the program. All travelers would be checked against Interpol databases, and visa-waiver countries would be required to issue "e-passports" with biometric information.

Some 20 million visitors come to the U.S. annually under the waiver program. They already are screened through an online system maintained by the Department of Homeland Security, and the White House has recently announced a series of improvements to that and other aspects of the program.

But in past years, the program has been used by would-be terrorists, including "shoe bomber" Richard Reid and Zacarias Moussaoui, the "20th hijacker," according to a Homeland Security inspector general's report from 2004.

Lawmakers of both parties spoke in favor of the legislation, which is also backed by the White House. It's a rare area of bipartisan agreement after the Obama administration's fury when the House passed legislation last month cracking down on the Syrian refugee program soon after the Paris attacks.

The Syrian refugee bill, which the administration said was unnecessary because the small number of Syrian refugees are extensively screened, has not gone anywhere in the Senate and looks unlikely to advance.

Separately, some lawmakers are talking about the fiance visa program that allowed Tashfeen Malik, the shooter in the attacks in San Bernardino, Calif., into the country. The Homeland Security Department has announced a review of that program.

Several Democrats spoke against the visa-waiver legislation. Rep. Keith Ellison (D., Minn.) said the bill was overbroad in stripping waiver privileges from all Syrians and Iraqis. "Our focus should be on terrorism, not just country or origin," he said.