Al-Kamil was the son of sultan al-Adil ("Saphadin"), a brother of Saladin. Al-Kamil's father was laying siege to the city of Mardin in 1199 when he was called away urgently to deal with a security threat in Damascus. Al-Adil left al-Kamil to command the forces around Mardin continuing the siege. Taking advantage of the Sultan's absence, the combined forces of Mosul, Sinjar and Jazirat ibn Umar appeared at Mardin when it was on the point of surrender, and drew Al-Kamil into battle. He was badly defeated and retreated to Mayyafariqin. However dissent and weakness among his opponents meant that Al-Kamil was able to secure Ayyubid rule in the Jazira region by taking Harran.
In 596/1200, after proclaiming himself Sultan, Al-Adil invited Al-Kamil to come from the Eastern Territories to join him in Egypt as his viceroy (na'ib) in that country. Al-Adil's second son, Al-Mu'azzam Isa, had already been made prince of Damascus in 594/1198. It appears that Al-Adil allowed Al-Kamil a fairly high degree of authority, since he oversaw much of the work on the Cairo citadel, issued decrees in his own name, and even managed to persuade his father to dismiss the powerful minister Ibn Shukr. Al-Kamil remained viceroy until his father's death in 1218 when he became Sultan himself.
In 1218 when Al-Adil died, the Ayyubid domains were divided into three parts, with Al-Kamil ruling Egypt, his brother Al-Muazzam Isa ruling in Palestine and Transjordan, and a third brother, Al-Ashraf Musa in Syria and the Jazira. Nominally the other two recognised Al-Kamil's supremacy as Sultan. Unusually for an Ayyubid succession, there was no obvious dissent or rivalry between the brothers at this point, partly because just before Al-Adil's death, Egypt had been attacked by the forces of the Fifth Crusade.
Al-Kamil took command of the forces which defended Damietta against the Crusaders. In 1219 he was almost overthrown by a conspiracy led by the amir Imad ad-Din ibn al-Mashtub, commander of the Hakkari Kurdish regiment, to replace him with his younger and more pliant brother al-Faiz Ibrahim. Alerted to the conspiracy, Al-Kamil had to flee the camp to safety and in the ensuing confusion the Crusaders were able to tighten their grip on Damietta. Al-Kamil considered fleeing to Yemen, which was ruled by his son Al-Mas'ud, but the timely arrival of his brother Al-Muazzam from Syria with reinforcements brought the conspiracy to a swift end.
Al-Kamil made many offers of peace to the Crusaders, all of which were rejected, due to the influence of the papal legate Pelagius. He offered to return Jerusalem and rebuild its walls (which his brother had torn down earlier in the year), and to return the True Cross (which he probably did not have). At one point he even negotiated with Francis of Assisi, who had accompanied the crusade, and who apparently tried to convert the sultan.