In 600, Abbot Probus was commissioned by Pope Gregory the Great to build a hospital in Jerusalem to treat and care for Christian pilgrims to the Holy Land. In 800, Charlemagne, Emperor of the Holy Roman Empire, enlarged Probus' hospital and added a library to it. About 200 years later, in 1005, Caliph Al Hakim destroyed the hospital and three thousand other buildings. In 1023, merchants from Amalfi and Salerno in Italy were given permission by the Caliph Ali az-Zahir of Egypt to rebuild the hospital in Jerusalem. The hospital, which was built on the site of the monastery of Saint John the Baptist, took in Christian pilgrims traveling to visit the Christian holy sites. It was served by Benedictine Brothers.
The monastic hospitaller order was founded following the First Crusade by the Blessed Gerard, whose role as founder was confirmed by a Papal bull of Pope Paschal II in 1113. Gerard acquired territory and revenues for his order throughout the Kingdom of Jerusalem and beyond. His successor, Raymond du Puy de Provence, established the first significant Hospitaller infirmary near the Church of the Holy Sepulchre in Jerusalem. Initially the group cared for pilgrims in Jerusalem, but the order soon extended to providing pilgrims with an armed escort, which soon grew into a substantial force.
The Hospitallers and the Knights Templar, formed in 1119, became the most powerful Christian groups in the area. The order came to distinguish itself in battles with the Muslims, its soldiers wearing a black surcoat with a white cross.
By the mid-12th century the order was clearly divided into military brothers and those who worked with the sick. It was still a religious order and had privileges granted by the Papacy; for example, the order was exempt from all authority save that of the Pope, and it paid no tithes and was allowed its own religious buildings. Many of the more substantial Christian fortifications in the Holy Land were built by the Templars and the Hospitallers. At the height of the Kingdom of Jerusalem the Hospitallers held seven great forts and 140 other estates in the area. The two largest of these, their bases of power in the Kingdom and in the Principality of Antioch, were the Krak des Chevaliers and Margat. The property of the Order was divided into priories, subdivided into bailiwicks, which in turn were divided into commanderies. Frederick Barbarossa, the Holy Roman Emperor, pledged his protection to the Knights of St. John in a charter of privileges granted in 1185.