Soon after the end of the fighting, the United Nations passed Security Council Resolution 242, calling for an Israeli withdrawal from territories recently occupied and an acknowledgement by the Arab nations of Israel's right to live in peace within secure borders.
Resolution 242 was designed to provide the framework for peace negotiations based on a "land-for-peace" formula and has become the foundation of all subsequent peace treaties in the region. The resolution called for the withdrawal of Israeli forces "from territories of recent conflict," an Arab "termination of all claims or states of belligerency," and a recognition of the State of Israel and its "right to live in peace within secure and recognized boundaries free from threats or acts of force." The resolution also called for "achieving a just settlement of the refugee problem."
As 242 called for Israel's "withdrawal from territories" and not "the" territories as part of a peace agreement, it is understood by the drafters of the resolution and by Israel and the United States that Israel may withdraw from areas of the West Bank and Gaza Strip consistent with its security needs, but not from all the territories.