Washington (AFP) - The House of Representatives voted Thursday to ban Syrian and Iraqi refugees from entering the United States until tougher screening measures are in place, a move some slammed as giving in to xenophobia after the Paris attacks.

The Republican legislation, the first congressional response to last week's murderous assaults, passed overwhelmingly, 289 to 137. Nearly four dozen Democrats went against their president to support the measure.

The bill now heads to the Senate, where its fate is uncertain, but it sets up a clash with President Barack Obama, who has threatened to veto the bill and has criticized Republicans for "hysteria" and falling short of their humanitarian duty to take in the oppressed.

"Our position on this piece of legislation has not changed," White House spokesman Josh Earnest said after the vote, reiterating that the bill would be vetoed.

House Republican Trey Gowdy told colleagues earlier in the day that the Islamic State group "has sworn to bring its war against innocents here."

"The margin for error is zero."

Thursday's yes votes were one shy of the 290 needed to override a veto if every member votes. But in the Senate, Minority Leader Harry Reid said the measure would face fierce opposition from Democrats.

The bill would prevent refugees from Iraq and Syria from reaching US shores until background checks are implemented as part of the screening process for each refugee.

It would also require directors of the Federal Bureau of Investigation, Department of Homeland Security, and Director of National Intelligence to personally certify that each new settler would not be a threat to national security.

Such a step, Democrats argue, would be a logistical nightmare for department heads who should be focusing more directly on stopping the Islamic State group and other extremists.

Republicans defend the measure as a common-sense necessity after the Paris attacks that killed 129 people.

"Today is not the day to share our territory," House Financial Services Committee chairman Jeb Hensarling told colleagues.

Story continues

- 'Where is our mercy?' -

Democrats took to the House floor to argue that US refugee vetting is already the most stringent in the world, with investigations by several federal agencies taking an average 18 to 24 months.

House Democrat Jerrold Nadler expressed incredulity that lawmakers would seek to block women, children and seniors fleeing violence in Syria and Iraq from entering the country as refugees.

"We might as well take down the Statue of Liberty," he said.

Others decried what they described as a knee-jerk reaction following the Paris attacks, one that hurts the very people who are fleeing extremism.

"Where is our mercy?" congresswoman Sheila Jackson Lee pleaded.

The refugee issue has erupted into a political football on the campaign trail.

Several Republican presidential candidates have suggested that Christian refugees be prioritized over Muslims because Christians are facing greater discrimination and abuse at the hands of IS.

But House Speaker Paul Ryan, speaking in support of the legislation, insisted "it's a security test, not a religious test."

"If our law enforcement and our intelligence community cannot verify that each and every person is not a security threat, then they shouldn't be allowed in."

Two dozen Republican governors have also expressed opposition to Obama's plan to resettle up to 10,000 Syrian refugees on US soil over the next year.

The issue burst into ugly view this week when a newly arrived, fully vetted Syrian refugee family of three was rerouted out of Indiana when Governor Mike Pence objected to Syrian refugees settling in his state.

Rights groups warned that such positioning merely plays into the hands of extremist groups.

"Sowing fear of refugees is exactly the kind of response groups like ISIS are seeking," said Iain Levine of Human Rights Watch.

The White House stressed that of the slightly more than 2,000 Syrian refugees who have resettled in the United States since 2011, none has been arrested or removed on terrorism charges.

Separately Thursday, US officials acknowledged that two Syrian families -- two men, two women and four children -- were detained at the Texas border.

The Department of Homeland Security said the Syrians "presented themselves at a port of entry in Laredo" on Tuesday and were taken into custody for further processing.

It was not immediately clear if the eight had US visas or were seeking asylum or refugee status.

"THIS is why Texas is vigilant about Syrian refugees," Texas Governor Greg Abbott posted on Twitter.