He succeeded his nephew, Malik Shah II, as Seljuq Sultan in Baghdad, and thus was theoretically the head of the dynasty, although his brother Ahmed Sanjar in Khorasan held more practical power. Muhammad I probably allied himself with Radwan of Aleppo in the battle of Khabur river against Kilij Arslan I, the sultan of Rüm, in 1107, in which the latter was defeated and killed. Following the internecine conflict with his half brother, Barkiyaruq, he was given the title of malik and the provinces of Armenia and Azerbaijan. Dissatisfied by this he revolted again, but had to flee back to Armenia. By 1104, Barkiyaruq, ill and tired of war, agreed to divide the sultanate with Muhammad. Muhammad became sole sultan following the death of Barkiyaruq in 1105. In 1106, Muhammad conquered the Ismaili fortress of Shahdiz, and ordered the BavandidrulerShahriyar IV to participate in his campaign against Ismailis. Shahriyar, greatly angered and feeling offended by the message Muhammad sent him, refused to aid him against the Ismailis. Shortly after Muhammad sent an army headed by Amir Chavli who tried to capture Sari but was unexpectedly defeated by an army under Shahriyar and his son Qarin III. Muhammad then sent a letter, which requested Shahriyar to send one of his sons child to the Seljuq court in Isfahan. He sent his son Ali I, who impressed Muhammad so much that he offered him his daughter in marriage, but Ali refused and told him to grant the honor to his brother and heir of the Bavand dynasty, Qarin III. Qarin III then went to Isfahan court and married her. In 1106/1107, Ahmad ibn Nizam al-Mulk, the son of the famous vizierNizam al-Mulk, went to the court of Muhammad I to file a complaint against the rais of Hamadan. When Ahmad arrived to the court, Muhammad I appointed him as his vizier, replacing Sa'd al-Mulk Abu'l-Mahasen Abi who had been recently executed on suspicion of heresy. The appointment was due mainly to the reputation of his Ahmad's father. He was then given various titles which his father held. Muhammad I, along with his vizier Ahmad, later made a campaign in Iraq, where they defeated and killed the Mazyadid ruler Sayf al-dawla Sadaqa ibn Mansur, who bore the title "king of the Arabs". In 1109, Muhammad I sent Ahmad and Chavli Saqavu to capture the Ismaili fortresses of Alamut and Ostavand, but they failed to achieve any decisive result and withdrew. Ahmad was shortly replaced by Khatir al-Mulk Abu Mansur Maybudi as vizier of the Sejluq Empire. According to Ali ibn al-Athir, Ahmad then retired to a private life in Baghdad, but according to the contemporary biographer, Anushirvan ibn Khalid, Muhammad I had Ahmad imprisoned for ten years. Muhammad I died in 1118 and was succeeded by Mahmud II, although after Muhammad II's death Sanjar was clearly the chief power in the Seljuq realms.