In 997 BC, King David won Jerusalem, and his son Solomon built the First Temple in 950 BC. In 587 BC, the Jerusalem was seized by Nebuchadnezzar, and many of the settlers were captured and taken away to Babylon. At the end of the Babylonian Exile, in 520 BC, the Second Temple was built in 332 BC.
Jerusalem was seized under Greek domination, becoming progressively Hellenized. In 167 BC, Antiochus IV Epiphanes and his soldiers desecrated the temple arousing the Maccabean revolt. Therefore, during the government of the Maccabees and the Hasmoneans, the town extended westward until Mount Zion.
In 63 BC, the Roman Empire took control of the city, and in 37 BC, Herod the Great became the king of Judea. He restored and enhanced the temple stage and implemented the city with palaces, a citadel, a theatre, a hippodrome, an agora, and other Hellenistic and Roman architectural styles. When he died in 4 BC, Jerusalem turned into the city of the high priests, i.e. Cohanim, under the government of Roman procurators. From AD 41 to 44, Agrippa I ruled Jerusalem, and he enlarged the city northward, building the Third Wall in the northern area.
In AD 70, Emperor Titus destroyed Jerusalem, and Emperor Hadrian also banning Jews from entering the city and renaming Jerusalem as Aelia Capitolina.
Jerusalem became a Christian city in AD 326 under the government of Emperor Constantine and his mother Helena, who ordered to build several churches.
This period ended when the Persians seized Jerusalem in AD 614. The Byzantines regained Jerusalem in AD 627, but in AD 638, the armies of Islam conquered the city. Subsequently, the Umayyad Caliphs ordered the construction of the Dome of the Rock and the El-Aqsa Mosque.
In 1099, Jerusalem became a Christian city again when the Crusaders conquered the city. The Crusaders built several churches, hospices and palaces.
Nevertheless, in 1187, the city of Jerusalem became again a town dominated by Islam when Saladin seized the city. Jerusalem remained under the siege of the Mamelukes from 1291 until 1517 and of the Ottomans from 1519 until 1917. During the Ottoman Empire, the present city walls had been built in 1537.
During the 19th century, the Christians dominated Europe and helped the Turkish Sultan against the Egyptian ruler Ibrahim Pasha. The Christians obtained rising control starting from 1840, building churches, schools, hospitals, and orphanages. The Pope established again the Latin Patriarchate, which was initially founded in 1099 and terminated in 1291.
Meanwhile, since the 13th century, an increasing number of Jews returned to live in Jerusalem. In 1267, Rabbi Moshe Ben Nachman Ramban, well-known as Nachmanides, founded a synagogue. In 1488, Jews from Egypt settled down in Jerusalem; moreover, Sephardic Jews emigrated to Jerusalem from Spain after the Ottoman Sultan offered them refuge from the Spanish Inquisition.
In December 1917, British armies invaded Jerusalem under the command of General Allenby. In July 1920, during the British Mandate, the seat of the High Commissioner was in Jerusalem. In 1947, the United Nations decided to divide Palestine between the Arabs and the Jews, and they wanted to make Jerusalem an internationalized city. In 1948, at the end of the British Mandate, Israeli and Jordanian troops battled to regain control of the city, and in 1949, Jerusalem became a partitioned city under a cease-fire agreement. In 1950, the Israelis declared West Jerusalem the capital of the State of Israel, and following the Six-Day War in 1967, they also joined East Jerusalem. In 1980, Israel declared Jerusalem with the whole Old City, the capital of Israel.