Ibrahim II Shaykhshah

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.

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.

In response to his loyalty, Ismail offered an engagement of between his daughter and Prince Khalil.