Saladin died in 1193, and there were frequent conflicts between different Ayyubid sultans ruling in Damascus and Cairo. Damascus was the capital of independent Ayyubid rulers between 1193 and 1201, from 1218 to 1238, from 1239 to 1245, and from 1250 to 1260. At other times it was ruled by the Ayyubid rulers of Egypt. During the internecine wars fought by the Ayyubid rulers, Damascus was besieged repeatedly.