Secretary of State John Kerry said Wednesday the Israeli refusal to stop building Jewish settlements on Palestinian territory is undermining any attempt to achieve a lasting peace in the region.

“The settler agenda is defining the future of Israel, and their stated purpose is clear,” Kerry said. “They believe in one state: greater Israel.”

EXCLUSIVE: John Kerry: Our Allies Won't Be Swayed by Trump Tweets

In an often-harsh, 70-minute plus speech, Kerry said the two-state solution that President Obama and his predecessors have been pushing for is "now in jeopardy" and the continued settlement building by the Israelis is cementing "a one-state reality that nobody really wants."

If Israel keeps annexing Palestinian territory, Kerry said, "it can be Jewish or Democratic — but it can't be both."

The current course also poses an existential threat to Israel, Kerry said.

"With all the external threat Israel faces today ... does it really want an intensifying conflict in the West Bank?" he said. "If Israel goes down the one-state path, it will never have true peace with the Arab world."

Related: What Are Israeli Settlements and Why Do They Matter?

In what's likely to be his final public address as Secretary of State before Donald Trump's administration takes over, Kerry called for "both sides to take significant steps on the ground to reverse current trends."

Kerry said the Palestinians have also been an impediment to the peace process by glorifying terrorists, trying to "delegitimize" Israel, and failing to control Hamas, "who have a one-state vision of its own."

Kerry spoke five days after the U.S. abstained when the Security Council voted to condemn the Jewish state for continuing to defy the world body by building new homes for Jews on Palestinian territory. The U.S broke with its longstanding policy of diplomatically shielding Israel on such matters.

The UN vote infuriated Israeli Prime Minister Benjamin Netanyahu, who has long had a tense relationship with President Obama — and who had taken the unusual step of trying to get President-elect Donald Trump to help scuttle the vote.

"We reject the criticism that this vote abandons Israel," Kerry said, noting that the U.S. and 'virtually every country in the world opposes the settlements besides Israel."

Kerry also took direct aim at Netanyahu's crack that "friends don't take friends to the Security Council."

“Some seem to believe that the U.S. friendship means the U.S. must accept any policy, regardless of our own interests, our own positions, our own words, our own principles — even after urging again and again that the policy must change,” he said. “Friends need to tell each other the hard truths, and friendships require mutual respect.”

Before Kerry spoke, Trump weighed in on Twitter, bashing the Obama administration and the Iran nuclear deal that both he and Netanyahu oppose.

“We cannot continue to let Israel be treated with such total disdain and disrespect. They used to have a great friend in the U.S., but.......not anymore. The beginning of the end was the horrible Iran deal, and now this (U.N.)! Stay strong Israel, January 20th is fast approaching!”

Netanyahu Tweeted back his thanks to Trump and mentioned Trump's daughter Ivanka and son Donald Jr.

President-elect Trump, thank you for your warm friendship and your clear-cut support for Israel! @IvankaTrump @DonaldJTrumpJr https://t.co/lURPimG0wS — Benjamin Netanyahu (@netanyahu) December 28, 2016

After the UN move, Netanyahu accused Obama, currently on vacation in his home state of Hawaii, of being behind the historic vote.

Not true, Kerry reiterated Wednesday.

"The United States did not draft this resolution," he said. "Nor did we put it forward."

Kerry's remarks echoed earlier statements in which he defended the U.S. decision to abstain saying it could not “stand in the way of a resolution at the United Nations that makes clear that both sides must act now to preserve the possibility of peace.”

The outgoing Secretary of State also reminded the Israelis that they have never had a better friend than the Obama administration.

"No American administration has done more for Israel's security than Barack Obama's," he said. "Time and again we have demonstrated we have Israel's back... More than half our global military financing goes to Israel."

Netanyahu disagreed. He said he was "disappointed" by Kerry's speech and said the Palestinians' refusal to recognize the existence of Israel — not the the building of settlements — was the reason for the years of conflict.

"No one wants peace more than the people of Israel," he said. "Israel looks forward to working with President-elect Trump... to mitigate the damage this resolution has done."

Netanyahu also repeated his claim that the Obama administration behind the UN resolution and said he will present to his proof to the Trump administration. He did not elaborate.

"Some of it is sensitive," he said. "It's all true."

Former Israeli Prime Minister Ehud Barak praised Kerry's speech as "powerful" and "lucid."

@JohnKerry Powerful, lucid speech. World & majority in Israel think the same. Bibi, on verge of messianic abyss, determined to go forward — אהוד ברק (@barak_ehud) December 28, 2016

Meanwhile, Sen. John McCain, R-Arizona, called Kerry's speech "at best a pointless tirade in the waning days of an outgoing administration."

"I support a two-state solution for Israel and the Palestinians," he said. "But this solution is simply not possible at this time because Israel has no viable partner for peace."

Like his White House predecessors, Obama pursued an Israeli-Palestinian peace deal that called for two independent states living side-by-side. And like his predecessors, Obama’s attempt ended in failure.

Kerry’s last ditch attempt to keep the process going is not likely to find much favor with the incoming Trump administration. The President-elect has already angered the UN by pledging to move the U.S. embassy from Tel Aviv to Jerusalem and he has picked for ambassador a lawyer named David Friedman who is a strong supporter of the Jewish settlements.

But by laying out a framework for a possible peace deal, Kerry appeared to be trying to box Netanyahu in even more with the UN, which long ago lost patience with the Israeli settlement building.

Still, ahead of Kerry’s speech, Netanyahu — in a move aimed at reducing tensions with Washington — prevailed on Jerusalem’s municipal government to cancel a scheduled vote the approve the building of 492 new housing units of annexed territory.

Israel has for decades pursued a policy of building Jewish settlements in defiance of the rest of the world, which views them as an obstacle to peace. Washington also considers the settlement activity illegitimate.

Israeli hardliners, however, say they have a Biblical right to the lands they call Judea and Samaria and contend a Palestinian state would pose a security threat.

Currently, some 570,000 Israelis live in the West Bank and East Jerusalem among more than 2.6 million Palestinians.