(AP) WASHINGTON – The House overwhelmingly approved a bipartisan measure Thursday that rebukes the United Nations for criticizing Israeli settlements as Republicans used the debate to accuse President Barack Obama of turning his back on the Jewish state.

Lawmakers voted 342-80 for the non-binding resolution that declares unwavering support for Israel and insists that the United States reject any future UN actions that are similarly “one-sided and anti-Israel.”

“Our government abandoned our ally Israel when she needed us the most,” said House Speaker Paul Ryan, R-Wis. “It is time to repair the damage done by this misguided hit job at the UN.”

The measure divided Democrats. Nearly 80 opposed the measure because they said it contained inaccuracies and distorted the complexities of the Middle East peace process. They also accused Republicans of attacking Obama unfairly in the waning days of his presidency.

“The point of the measure seems to be to bash Obama on the way out,” said Rep. Gerry Connolly, D-Va., who along with many other Democrats still voiced strong support for Israel. They said Obama deserved credit for engineering last year’s new, long-term security agreement that gives Israel $38 billion in US military aid, including $5 billion for missile defenses.

A similar bipartisan measure to reprimand the UN has been introduced in the Senate. “Israel is always the bad guy in the eyes of the United Nations,” said Sen. Lindsey Graham, R-S.C., one of the measure’s co-sponsors.

Attention from the move by the UN last month could provide fuel for pro-Israel initiatives favored by conservatives on Capitol Hill. For example, a small group of Republican senators is proposing to withhold 50 percent of the State Department’s 2017 budget until the US Embassy in Israel is moved from Tel Aviv to Jerusalem. During the campaign, President-elect Donald Trump promised to shift the embassy.

But a spokesman for Jordan’s government told The Associated Press on Thursday that the embassy move would be a “red line” for Jordan and “inflame the Islamic and Arab streets.” Jordan serves as custodian of a major Islamic shrine in east Jerusalem and the Palestinians seek a capital there.

Israel and its supporters lashed out at Obama for his decision to abstain and allow the UN Security Council to approve in December a resolution calling Israel’s settlements in the West Bank and east Jerusalem “a flagrant violation under international law.”

Although the US is opposed to the settlements, it has traditionally used its veto power as a permanent member of the Security Council to scuttle resolutions that condemn Israel. Disputes between Israel and the Palestinians must be resolved through direct negotiations, according to longstanding practice and policy.

Benjamin Netanyahu, Israel’s prime minister, accused Obama of a “shameful ambush” and said he was looking forward to working with Trump, whom he described as his friend.

But Secretary of State John Kerry said in a late December speech that the US was standing up for a two-state solution when it abstained on the resolution. He criticized Israel for settlement building and blamed Netanyahu for dragging Israel away from democracy.

Kerry said expanding Israeli settlements in the West Bank and east Jerusalem are leading to an “irreversible one-state reality.”

The Palestinians seek the West Bank and east Jerusalem, territories captured by Israel in the 1967 war, for an independent state. They say that Israeli settlements in these areas, now home to about 600,000 Israelis, are threatening their plans for independence by taking in lands where they hope to establish their state.

The UN resolution, along with Kerry’s speech, essentially endorsed the Palestinian position by calling for the pre-1967 lines to serve as the reference point for a final border.

Netanyahu, who opposes a return to the 1967 lines, has condemned the moves as “skewed” and “shameful.”

Rep. Ed Royce of California, the Republican chairman of the Foreign Affairs Committee, and Rep. Eliot Engel of New York, the panel’s top Democrat, sponsored the House measure. The UN resolution “undermines the prospect for Israelis and Palestinians resuming productive, direct negotiations,” according to their legislation, and should be “repealed or fundamentally altered.”