Despite incomplete archaeological work, it is evident that Jerusalem was occupied as far back as the 4th millenium B.C. In the late Bronze Age (2000–1550 B.C.), it was a Jebusite (Canaanite) stronghold. David captured it (c.1000 B.C.) from the Jebusites and walled the city. After Solomon built the Temple on Mt. Moriah in the 10th cent. B.C., Jerusalem became the spiritual and political capital of the Hebrews. In 586 B.C. it fell to the Babylonians, and the Temple was destroyed.
The city was restored to Hebrew rule later in the 6th cent. B.C. by Cyrus the Great, king of Persia. The Temple was rebuilt (538–515 B.C.; known as the Second Temple) by Zerubbabel, a governor of Jerusalem under the Persians. In the mid-5th cent. B.C., Ezra reinvigorated the Jewish community in Jerusalem. The city was the capital of the Maccabees in the 2d and 1st cent. B.C.
After Jerusalem had been taken for the Romans by Pompey, it became the capital of the Herod dynasty, which ruled under the aegis of Rome. The Roman emperor Titus ruined the city and destroyed the Temple (A.D. 70) in order to punish and discourage the Jews. After the revolt of Bar Kokba (A.D. 132–35), Hadrian rebuilt the city as a pagan shrine called Aelia Capitolina but forbade Jews to live on the site.
With the imperial toleration of Christianity (from 313), Jerusalem underwent a revival, greatly aided by St. Helena, who sponsored much building in the early 4th cent. Since that time Jerusalem has been a world pilgrimage spot. Muslims, who believe that the city was visited by Muhammad, treated Jerusalem favorably after they captured it in 637, making it the chief shrine after Mecca. From 688 to 691 the Dome of the Rock mosque was constructed.
In the 11th cent. the Fatimids began to hinder Christian pilgrims; their destruction of the Church of the Holy Sepulcher helped bring on the Crusades. Jerusalem was conquered by the Crusaders in 1099 and for most of the 12th cent. was the capital of the Latin Kingdom of Jerusalem. In 1187, Muslims under Saladin recaptured the city. Thereafter, under Mamluk and then Ottoman rule, Jerusalem was rebuilt and restored (especially by Sulayman I); but by the late 16th cent. it was declining as a commercial and religious center.
In the early 19th cent., Jerusalem began to revive. The flow of Christian pilgrims increased, and churches, hospices, and other institutions were built. Jewish immigration accelerated (especially from the time of the Egyptian occupation of Jerusalem by Muhammad Ali in 1832–41), and by 1900, Jews made up the largest community in the city and expanded settlement outside the Old City walls.
In 1917, during World War I, Jerusalem was captured by British forces under Gen. Edmund Allenby. After the war it was made the capital of the British-held League of Nations Palestine mandate (1922–48). As the end of the mandate approached, Arabs and Jews both sought to hold sole possession of the city. Most Christians favored a free city open to all religions. This view prevailed in the United Nations, which, in partitioning Palestine into Arab and Jewish states, declared that Jerusalem and its environs (including Bethlehem) would be an internationally administered enclave in the projected Arab state. Even before the partition went into effect (May 14, 1948), fighting between Jews and Arabs broke out in the city. On May 28, the Jews in the Old City surrendered. The New City remained in Jewish hands. The Old City and all areas held by the Arab Legion (East Jerusalem) were annexed by Jordan in Apr., 1949. Israel responded by retaining the area it held. On Dec. 14, 1949, the New City of Jerusalem was made the capital of Israel.
In the Arab-Israeli War of 1967, Israeli forces took the Old City. The Israeli government then formally annexed the Old City and placed all of Jerusalem under a unified administration. Arab East Jerusalemites were offered regular Israeli citizenship but chose to maintain their status as Jordanians. Israel transferred many Arabs out of the Old City but promised access to the holy places to people of all religions. In July, 1980, Israel's parliament approved a bill affirming Jerusalem as the nation's capital. With suburbanization and housing developments in formerly Jordanian-held territory, Jerusalem has become Israel's largest city. Strife between Arabs and Jews persists. The issue of the status of East Jerusalem, annexed by Israel but regarded by Palestinians as the eventual capital of their own state, remains difficult. In 1998, Israel announced a controversial plan to expand Jerusalem by annexing nearby towns.