Ban spoke as he made a farewell visit to Israel and the Palestinian Authority. He visited the Gaza, met Netanyahu and later held talks with PA chairman Mahmoud Abbas.

He condemned a recent wave of Palestinian attacks, which he called "terrorism", but also said Israel’s naval blockade on Gaza was "collective punishment".

Speaking alongside Netanyahu at the prime minister's office in Jerusalem, Ban called for efforts to keep the possibility of a two-state solution alive.

While acknowledging the threats facing Israel, Ban said "we must not allow difficulties to become excuses for inaction".

"I encourage you to take the courageous steps necessary to prevent a one-state reality or perpetual conflict that is incompatible with realising the national aspirations of the Israelis and Palestinian people," he told Netanyahu.

"We cannot ignore key underlying causes of violence: growing Palestinian anger, the paralysis of the peace process, the nearly a half-century of occupation,” said Ban.

At the same time, he also said that “stabbings, vehicle rammings and shootings have only one name: terrorism.”

"Incitement to such acts and glorification of their perpetrators are unacceptable and must be stopped," he added.

Ban specifically mentioned the recent attack in the Sarona Market in Tel Aviv, but said security measures would not be enough to stop the terrorism.

"You need a political horizon," he said. "You need a leadership that is committed to peace and a just and a lasting solution.”

Netanyahu, for his part, called for an end to what he referred to as bias at the United Nations against Israel, citing repeated condemnations of his country.

Israel "does more to promote and protect human rights and liberal values than any other in the blood-soaked Middle East," Netanyahu told the UN chief.

In Gaza, Ban said the blockade of the Palestinian enclave "suffocates its people, stifles its economy and impedes reconstruction efforts."

"It is a collective punishment for which there must be accountability," he said.

Later in the evening Ban met Abbas at the Palestinian leader's Ramallah headquarters and again spoke of the need for peace and the difficulties Palestinians face.

"I'm aware that many Palestinians question the feasibility of reaching a just and lasting peace with Israel. They hear talk of peace but they see violence," he said.

"They still live a life of checkpoints, permits, blockade, demolitions and profound economic hardships faced with growing indignities and the humiliating occupation that will soon enter its 50th year,. He charged"

Abbas said Palestinians seek peace based on a two-state solution and called for "international protection" for his people.

Ban’s visit, which comes as he prepares to step down as UN chief at the end of the year, is taking place amid a renewed push on Israel and the PA to renew peace talks that have been stalled for two years.

France is at the forefront of these efforts, having on June 3 hosted a summit in Paris in which foreign ministers discussed ways in which the international community could "help advance the prospects for peace, including by providing meaningful incentives to the parties to make peace."