A defiant Secretary of State John Kerry on Wednesday defended the U.S. decision allowing the United Nations to condemn Israeli settlements, while lashing out at the so-called “settler agenda” which he claimed is hurting prospects for peace – in a wide-ranging speech that inflamed tensions with Israel and drew a swift rebuke from the prime minister.

During a farewell speech at the State Department, Kerry explained the U.N. decision in his most extensive terms yet. He said it was about preserving the two-state solution, which he called the only way to a “just and lasting peace.”

“That future is now in jeopardy,” he warned.

A U.S. abstention on the U.N. Security Council resolution calling Israeli settlements in the West Bank and East Jerusalem a violation of international law allowed the measure to pass Friday – and sent the already-turbulent relationship between the Obama and Netanyahu governments into its rockiest stretch yet.

In a written statement, Prime Minister Benjamin Netanyahu ripped Kerry's speech as "skewed."

"Like the Security Council resolution that Secretary Kerry advanced in the UN, his speech tonight was skewed against Israel," he said. "For over an hour, Kerry obsessively dealt with settlements and barely touched upon the root of the conflict -- Palestinian opposition to a Jewish state in any boundaries."

In subsequent remarks from Jerusalem, Netanyahu defended his country’s commitment to peace and said: “Israelis do not need to be lectured about the importance of peace by foreign leaders.”

He said he looks forward to working with the incoming Trump administration to “mitigate” the damage from the resolution and ultimately “repeal” it.

While Israeli officials have described the U.S. abstention as a betrayal, the Obama administration has also faced bipartisan criticism from U.S. lawmakers. House Speaker Paul Ryan tweeted Wednesday, “After allowing this anti-Israel resolution to pass the UN, Secretary Kerry has no credibility to speak on Israeli-Palestinian peace.”

Kerry, though, on Wednesday rejected criticism “that this vote abandons Israel” and described the resolution as a call for both sides to save the two-state solution “while there is still time.”

“We did not take this decision lightly,” Kerry said.

He said Israel's "permanent settlement construction," not the resolution, is risking peace.

“Friends need to tell each other the hard truths, and friendships require mutual respect,” Kerry said. He said the U.S. “did in fact vote in accordance with our values.”

In an at-times scathing address, Kerry went on to blast the “settler agenda” for allegedly pushing Israel toward seeking one state – which he asserted could not be both Jewish and democratic. He called the current government the "most right-wing" in Israel's history and claimed its agenda is "driven by the most extreme elements."

“The status quo is leading toward one state and perpetual occupation,” Kerry said. Using pointed language, he said this would entail “separate” but “unequal” treatment for Palestinians.

Kerry condemned Palestinian violence, including hundreds of terror attacks in the last year, and said Palestinian leaders do not do enough to speak out against specific attacks.

But the bulk of his address dealt with Israeli settlement expansion, largely in the West Bank, as he outlined "principles" for future peace talks -- and denied the U.S. drove last week's U.N. vote.

“In the end, we could not in good conscience protect the most extreme elements of the settler movement as it tries to destroy the two state solution. We could not in good conscience turn a blind eye to Palestinian actions that fan hatred and violence,” Kerry said.

The speech touched off a new round of rebukes from the Israeli government.

Israel's U.N. Ambassador Danny Danon said in a statement: "The Obama Administration acted against Israel at the UN and any claim to the contrary is a distortion of reality."

Netanyahu already has described the U.S. abstention that allowed the U.N. resolution to pass as an “ambush,” and his government has gone on to accuse the U.S. of playing a hand in orchestrating the vote.

The Israeli government, meanwhile, has turned to President-elect Donald Trump’s incoming administration for support, openly saying they look forward to working with the next president amid fraying ties with the outgoing administration.

In the hours before Kerry’s speech, the Netanyahu government took another shot at the U.S., with Public Security Minister Gilad Erdan calling Kerry’s speech a “pathetic step.”

He told Israel Army Radio that “Kerry's intention is to chain President-elect Trump."

Trump also blasted the administration on Twitter over its treatment of Israel, vowing a new approach once he's inaugurated.

On Wednesday, Kerry also outlined what he described as “principles” that could provide the basis for new talks. This included a return to borders negotiated based on the 1967 lines “with mutually agreed equivalent swaps” – a position similar to President Obama’s stated position several years ago.

He called for “two states for two peoples” with “equal rights for all” and a resolution for Jerusalem as the capital of the two states.

He said the U.S. acknowledges Israel’s “profound historic and religious ties to [East Jerusalem] and its holy sites.” He further said he understands some settlements would become part of Israel in a future two-state solution.

Kerry also vehemently denied claims the U.S. was the “driving force” behind the U.N. measure.

“The United States did not draft or originate this resolution, nor did we put it forward,” he said. “It was drafted and … introduced by Egypt … in coordination with the Palestinians and others. “

The White House on Wednesday also denied a report in Egyptian media claiming Kerry and National Security Adviser Susan Rice discussed the U.N. resolution with a top Palestinian official nearly two weeks before Friday’s Security Council vote.

Ned Price, spokesman for the U.S. National Security Council, called the reports a “fabrication” and said the “meeting never occurred.”

Netanyahu, though, reiterated Wednesday that his government has “absolutely incontestable evidence” that the U.S. organized and advanced the resolution. And he referred to the details reported in Egyptian media as the “tip of the iceberg.”

The State Department’s own website reflects that Kerry was scheduled for a meeting with the Palestinian official at the State Department on Dec. 12, around the time of the reported discussions. The official website, however, offers no details on what was discussed.

The Associated Press contributed to this report.