The History of Jerusalem during the Kingdom of Jerusalem began with the siege of the city in 1099 as part of the First Crusade. This resulted in Jerusalem being conquered by Christian forces, after it had been under Muslim rule for nearly 450 years. It became the capital of the Latin Kingdom of Jerusalem, until it was again conquered by the Ayyubids under Saladin in 1187. For the next forty years, a series of Christian campaigns, including the Third and Fifth Crusades, attempted in vain to retake the city, until Holy Roman Emperor Frederick II led the Sixth Crusade and successfully negotiated its return in 1229.