When Sultan Mahmut died, his son, Davud in Hamedan was declared as the sultan at a very young age. Although the sovereignty of Davud was recognised in Azerbaijan, Mes'ud declared his sultanate in Iraq. Upon the encouragement of his Tutor, Karaca-Saki, Seljuk-shah who was the ruler of Fars and Huzistan had also involved in the sultanate struggles between these two persons. Mes'ud had applied to the caliph in order to deliver the prayers in his name, but the caliph had stated that Sultan Sencer had the authority to determine the person in whose name the prayers would be delivered in Baghdad. In order to resolve this complicated situation within Iraq Seljuks State, Sultan Sencer had set off to come to the city of Rey. When this progress of Sultan Sencer was heard in Baghdad, Mes'ud proposed alliance with the caliph Mustersid, Seljuk-shah and Karaca Saki. According to this collaboration, Mes'ud would become the sultan, Seljuk-shah would become the crown prince and the caliph would dominate Iraq through his representative. Sultan Sencer had decided to enthrone his nephew, Tugrul to the throne of Iraq Seljuks State and he came to Hamedan. As a result, the armies of both sides fought within the environs of Dinever. Tugrul commanded the right wing of the army of Sencer. Seltan Sencer won this war (26th May 1132). The ruler Mes'ud preferred to run away and Karaca Saki who was taken as prisoner was killed by Sultan Sencer. When Sultan Sencer enthroned Tugrul as the sultan of the Iraq Seljuks State, he went to the Transoxania upon a rebellion of Karahanli State.

The first person who opposed to the sultane of Tugrul II was his nephew, Davud. Davud came in front of Hamedan with his army that he had organised and he was defeated by Tugrul in the war that took place within the environs of this city. Davud went to Baghdad. In this place, an alliance among Mes'ud, Davud and the Caliph Mustersid was established against Tugrul. The Caliph declared Mes'ud as the ruler and sovereign. The allied forces in the command of Mes'ud won a victory in the war near Hamedan against Tugrul II (1133) and they captured this city. The sultan who was defeated had to go firstly to Rey and then to Isfahan. But as a result of the pursuit of Mes'ud, he ran away towards the province of Fars.

When his retinue and attendants changed side and took part with Mes'ud, he got afraid of being taken as prisoner, and he returned to Rey again. Before Tugrul entered into the city of Rey, he fought with Mes'ud again (August 1133). Tugrul took shelter in Ala ed-Devle Ali b. Sehriyar from Bavendi people that dominated in Taberistan and he spent the winter of 1133 with this person. Then, the rebellion of Davud against Mes'ud in Azerbaijan gave an opportunity to Tugrul II in order to collect and organise an army. The armies of Tugrul and Mes'ud fought within the environs of Kazvin again. When some of the emirs within the army of Mes'ud took side with Tugrul, he lost this war (July 1134) and he ran away to Baghdad. Pursuant to this victory, Tugrul II was definitely enthroned as the sultan of Iraq Seljuks State in Hamedan. However, he got sick and died after a short period (24th October 1134).