The foreign-policy establishment and the mainstream media agree: David Friedman isn’t their kind of US ambassador to Israel.

He’s just too pro-Israel for their taste.

Friedman has been taking a pounding from the old hands who have represented Washington in the Middle East and their media echo chamber ever since President Trump named his former bankruptcy attorney to the post. While there’s nothing new or unusual about presidents naming their friends and donors to ambassadorial posts, Israel has always been an exception.

The primary responsibility of US ambassadors, other than speaking up for America’s interests and values, is to foster good relations between Washington and wherever it is they’ve been posted. Not so with Israel.

Every one of Friedman’s predecessors was either a career foreign-service officer or a product of foreign-policy think tanks who all saw Israel as a problematic friend that, regardless of its virtues, needed to be brought to heel in order to foster peace.

They agreed that the special relationship with the Jewish state was an irritant to relations with the Arab and Islamic world, and it could only be resolved by forging a land-for-peace deal that created an independent Palestinian state.

That’s why all previous US ambassadors — including those who were Jewish — acted more like imperial proconsuls who were there to give orders to a client state rather than a conventional envoy tasked with fostering good relations between the two governments.

So it’s easy to understand why current and foreign US diplomats have been up in arms about Friedman. As Politico noted last week, the State Department isn’t used to having an ambassador there who pushes back against US criticisms of Israel rather than leading the charge against the Jewish state’s government.

They were infuriated by Friedman’s success in helping to persuade Trump to finally recognize that Jerusalem is Israel’s capital. They were also shocked when Friedman outmaneuvered former Secretary of State Rex Tillerson, who had hoped to postpone the actual moving of the embassy to Jerusalem from Tel Aviv. Friedman rightly saw no reason to wait years until a new embassy building could be built when all that had to be done was to change the designation of the US consulate to the holy city.

Friedman’s vocal support for Israel’s defense of its border with Gaza during the “March of Return” — when violence organized by Hamas led to the deaths of dozens of those trying to cross into the Jewish state to create mayhem — was considered inappropriate by other diplomats. The foreign press was also outraged by his comments that noted most of the media coverage of Israel is biased against the Jewish state.

Friedman was right about the embassy and the media coverage, but it’s also true that his statements reflect the fact that the Long Island native is a lifelong pro-Israel activist — and a supporter of the Israeli right, at that — rather than his current job status. Yet the question is not whether his behavior was wrong — it wasn’t — but if having an ambassador to Israel who loves the Jewish state so much undermines the chances for peace.

Were the Palestinian Authority or its Hamas rivals interested in a two-state solution (or any kind of peace deal with Israel), the answer might be maybe. But even as the Trump administration prepares its own peace plan, it’s clear this isn’t the case.

The PA and its leader, Mahmoud Abbas, continue to spew anti-Semitism and make clear they aren’t interested in anything that’ll end the conflict or recognize Israel’s legitimacy, no matter where its borders are drawn. And Hamas is still pushing for “return” — which is to say, Israel’s destruction.

In the absence of a peace partner, Friedman’s pro-Israel boosterism is not only not an obstacle to peace, it’s a refreshing reminder to the State Department that it should care more about supporting its sole democratic ally in the region and holding the Palestinians accountable for their behavior and less about bludgeoning Prime Minister Benjamin Netanyahu to make concessions to those who desire Israel’s destruction.

While no one is used to having an ambassador there who is a truth-teller about the conflict, Friedman deserves credit, not censure.

Jonathan S. Tobin is editor in chief of JNS.org and a contributor to National Review.