The House overwhelmingly voted Tuesday to bar people who have visited Iraq and Syria in the past five years from a program that allows visa-free entry to the U.S.

The measure, passed 407-19, is part of lawmakers' efforts to ensure the U.S. is secure following terrorist attacks that killed 130 people in Paris and 14 in San Bernardino, California. One of the San Bernardino attackers had come to the U.S. on a fiancee visa but didn't participate in the State Department's visa waiver program.

"We simply cannot give people from other countries special access to our country if we don't have all the information we need to ensure they are not a threat to our national security," said bill sponsor Candice Miller, a Michigan Republican. "Obviously the world is a very different place" than when the visa waiver program was created, she said.