From the end of the
Ottoman–Mamluk War in 1517 until the
First World War, Jerusalem was part of the
Ottoman Empire. Since the 1860s, Jews have formed the largest religious group in the city and since around 1887, Jews have been in the majority.
 In the 19th century, European powers vied for influence in the city, usually on the basis of extending protection over Christian churches and Holy Places. A number of these countries also established consulates in Jerusalem. In 1917 and following the First World War, Great Britain was in control of Jerusalem; from 1923 as part of the
Mandate of Palestine. The principal
Allied Powers recognized the unique spiritual and religious interests in Jerusalem among the world's
three great monotheistic religions as "a sacred trust of civilization",
 and stipulated that the existing rights and claims connected with it be safeguarded in perpetuity, under international guarantee.
However, the Arab and Jewish
communities in Palestine were in mortal dispute and Britain sought United Nations assistance in resolving the dispute. In November 1947, the
United Nations General Assembly adopted the
United Nations Partition Plan for Palestine (Resolution 181), which called for the partition of Palestine into Arab and
Jewish states, with Jerusalem being established as a
corpus separatum, or a "separated body" with a special legal and political status, administered by the United Nations.
 Jewish representatives accepted the partition plan, while representatives of the Palestinian Arabs and the Arab states rejected it, declaring it illegal.
In May 1948, the Jewish community in Palestine issued the
declaration of the establishment of the State of Israel. Israel became a member of the United Nations the following year and has since been
recognised by most countries.
 The countries recognizing Israel did not recognize its sovereignty over Jerusalem generally, citing the UN resolutions which called for an international status for the city.
With the declaration of the establishment of the State of Israel and the subsequent
invasion by surrounding Arab states, the UN proposal for Jerusalem never materialised. The
1949 Armistice Agreements left
control of the eastern parts of Jerusalem, while the western sector was held by Israel.
 Each side recognised the other's
de facto control of their respective sectors.
 The Armistice Agreement, however, was considered internationally as having no legal effect on the continued validity of the provisions of the partition resolution for the internationalisation of Jerusalem.
 In 1950, Jordan annexed East Jerusalem as part of its larger
annexation of the West Bank. Though the United Kingdom and Pakistan recognized Jordanian rule over East Jerusalem,
 no other country recognized either Jordanian or Israeli rule over the respective areas of the city under their control.
Six-Day War of 1967, Israel declared that
Israeli law would be applied to
East Jerusalem and enlarged its eastern boundaries, approximately doubling its size. The action was deemed unlawful by other states who did not recognize it. It was condemned by the UN Security Council and General Assembly which described it as an annexation and a violation of the rights of the Palestinian population. In 1980, Israel passed the
Jerusalem Law, which declared that "Jerusalem, complete and united, is the capital of Israel".
 The Security Council declared the law null and void in
Resolution 478, which also called upon member states to
withdraw their diplomatic missions from the city. The UN General Assembly has also passed numerous resolutions to the same effect.