Secretary of State John Kerry delivered a strident lecture Wednesday aimed at Israel, defending the so-called two-state solution and warning that if the Israeli government failed to heed him, it would cease to exist.

“If the choice is one state, Israel can either be Jewish or democratic. It can’t be both,” Kerry said.

He claimed that “the status quo is leading toward one state, or perpetual occupation.”

Instead, America’s top diplomat called the two-state solution the “only way to achieve a just and lasting peace for Israelis and Palestinians.”

Pledging to offer “candid thoughts” on the Israeli-Palestinian conflict, Kerry used the address at the State Department — delivered with less than a month before the end of the Obama administration — to take aim at Israel’s government as being “the most right-wing in the Israeli history, with an agenda driven by the most extreme elements.”

“The vote in the United Nations was about preserving a two-state solution — that’s what we were standing up for,” Kerry said. “That’s what we were standing up for: Israel’s future as a Jewish and democratic state, living side by side in peace and security with its neighbors. That’s what we are trying to preserve, for our sake and for theirs.”

The vote by the international body — in which the US abstained — condemned Israeli settlements as illegal. “We could not in good conscience protect the most extreme elements of the settler movement while they destroy the two state solution,” Kerry said.

Kerry claimed that the decision to allow the UN Security Council to condemn Israeli settlements was “in accordance with” US values.

And he took a swipe at Israel Prime Minister Benjamin Netanyahu, who has famously had a contentious relationship with President Obama.

“The Israeli prime minister publicly supports a two-state solution, but his current coalition is the most right wing in Israeli history, with an agenda driven by its most extreme elements,” Kerry said.

“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. Friends need to tell each other the hard truths, and friendships require mutual respect,” he added.

Kerry even implied that the Jewish state was ungrateful for all the Americans had done for them.

“No American administration has done more for Israel’s security than Barack Obama’s,” he said.

The Israel prime minister’s office slammed the speech shortly after it ended.

“Like the resolution that John Kerry advanced at the UN, John Kerry gave a skewed speech against Israel. For over an hour, Kerry dealt obsessively with the settlements and almost didn’t touch on the root of the conflict — the Palestinian opposition to a Jewish state in any boundaries,” the statement said.

Pro-Israel groups were apoplectic at the Obama administration’s eleventh hour hit.

“Kerry’s speech was clueless, dishonest, and anti-Israel — but that’s not what matters now,” said Noah Pollak, executive director of the Emergency Committee on Israel.

“What matters is whether Obama now goes back to the UNSC to pass another anti-Israel resolution. Kerry’s speech will be quickly forgotten as yet more windbaggery from the worst secretary of state in US history,” Pollak said.