The short answer
Immediately before the State of Israel was declared in May 1948, Jerusalem was part of British-administered Mandatory Palestine. Before the British, the city belonged to the Ottoman Empire, which ruled it for about 400 years. “Owned” is a loose word here: for most of history, Jerusalem has been governed by empires and dynasties rather than owned in a modern legal sense.
The British Mandate period
British forces took Jerusalem in December 1917, during the First World War. The League of Nations later gave Britain a mandate to administer Palestine, which began in the early 1920s. Jerusalem served as the administrative capital. The Mandate ended in 1948 amid growing conflict between Jewish and Arab communities. A 1947 UN plan had proposed that Jerusalem be placed under special international administration, but this was never put into effect.
Ottoman rule, 1517–1917
The Ottomans took the region from the Mamluks in 1516–1517. Under Suleiman the Magnificent, the city’s walls were rebuilt in the 1530s, and those walls still stand today. The Ottomans governed Jerusalem for four centuries, until the First World War.
Mamluks, Ayyubids and Crusaders
Before the Ottomans, the Mamluk sultanate of Egypt held Jerusalem from the thirteenth century. The Ayyubid dynasty, founded by Saladin’s family, ruled before them. In between, Crusaders held the city from 1099 to 1187 as the Kingdom of Jerusalem, and briefly again from 1229 to 1244. The overview of the kingdom’s history explains that period.
Earlier empires
Going further back, Jerusalem passed through many hands:
- local Canaanite and Jebusite inhabitants, and then the Israelite and Judean kingdoms
- the Babylonians, who destroyed the city in 586 BCE
- the Persians, then Alexander and his successors
- the Hasmonean kingdom, then Rome
- the Byzantine Empire
- the early Muslim caliphates, followed by dynasties such as the Fatimids and Seljuks
1948 and after
After the 1948 war, Jerusalem was divided. Jordan held the eastern part, including the Old City, and Israel held the western part. In 1967 Israel took the eastern part. Its status remains disputed, and many countries do not recognize Israel’s claim over the whole city. For a related question, see who had Jerusalem first, Muslims or Christians.