The Kingdom of Jerusalem was a crusader state accepted in the Southern Levant by Godfrey of Bouillon in 1099. The history of Jerusalem during the Middle Ages began as a major city in the Byzantine Empire. Jerusalem prospered during the early centuries of Muslim control (640–969), but under the rule of the Fatimid caliphate which was from late 10th to 11th centuries, its population declined from about 200,000 to less than half that number by the time of the Christian conquest in 1099. The kingdom lasted nearly two hundred years, from 1099 until 1291.