Ibrahim II Shaykhshah

Sheykh Ibrahim II was the 40th shah of Shirvan.

Coming to power
Not much is known about his childhood. He fled to Nowshahr after his grandfather Gazi Beg's disastrous defeat. Having heard news that the Safavid ruler Ismail I was coming after him, he fled to Gilan, where he hid for two years. In 1502, a rebellion erupted in Shirvan and his nephew Sultan Mahmud was deposed. Local people invited Ibrahim to the throne of Shirvan same year.

Reign
In his 3rd year of rule, Shah Ismail I besieged Gulustan castle in order to restore Mahmud who fled to his court after deposition. After three months of siege, unexpectedly, a slave of Mahmud beheaded him at night and sent his head to Ibrahim. Sheykhshah, excited by the news, suddenly made a raid on besieging Safavid forces and forced them to flee. Despite victory, he accepted to be vassal of Ismail.

Relations with Safavids
In 1507, Sheykhshah rebelled against the Safavids but was forced to make peace again in 1509. He visited Tabriz in 1518 as a guest of Ismail I. In response to his loyalty, Ismail offered an engagement of between his daughter and Prince Khalil. In 1523, Ismail married a daughter of Sheykhshah.

Family
Sheykshah fathered seven sons, only 4 of them is known:
 * Prince Khalil
 * Prince Muhammad - d. 1528 in a battle with Uzbeks in army of Tahmasp I.
 * Prince Muzaffar - fled to the Gazikumukh Shamkhalate.
 * Prince Farrukh Yassar - fled to the Gazikumukh Shamkhalate.