Ban spoke to the UN Security Council after returning from a visit to the Middle East where he saw first-hand the destruction in Gaza wrought by the 50-day war between Israel and Hamas militants.
"Leaders on both sides must overcome their differences and dispense with the unilateral initiatives that serve only to fuel mistrust and polarization," the secretary general said.
The appeal came after Palestinian youths attacked an apartment building taken over by Jewish settlers in east Jerusalem and as the Palestinians pushed for a divisive UN resolution on ending the Israeli occupation in 2016.
Describing the two-state solution as the "only viable option" for peace, Ban said: "It is time for courage and vision to make the tough compromises that are needed now. I challenge both sides to rise to the occasion."
More From This Section
The UN chief called on Israel to reverse settlement activity which he emphasized were "illegal" and expressed concern over clashes sparked by Jewish visits at holy sites in Jerusalem.
"International law is clear: settlement activity is illegal. It runs totally counter to the pursuit of a two-state solution," he said.
In his address to the council, Palestinian envoy Riyad Mansour said the "time is past due to acknowledge that Israel, the occupying power, rejects peace and is deliberately destroying the two-state solution."
Mansour appealed to the 15-nation council to support the draft resolution on setting 2016 as the date for an Israeli withdrawal from the West Bank and Gaza, and to set a course for Palestinian statehood.
He invited the council ambassadors to visit Gaza, as Ban did last week, and emphasized the "centrality" of the United Nations in the search for peace after US efforts to re-start peace talks failed.