Muhammad II of Shirvan

Muhammad II (محمد) was the third Layzanshah (king of Layzan, r. 917–948) and the sixth Shirvanshah (king of Shirvan, r. 948–956). He was the son of Abu Tahir Yazid. He is often mislabeled as Muhammad III because of sharing same name with Muhammad of Layzan, who was in fact his grandfather and never ruled as Shirvanshah.

Under Yazid
Muhammad II is first mentioned in 917, when he was appointed as the ruler of Layzan and Tabarsaran by his father Abu Tahir ibn Yazid. He had younger brothers called Ahmad and Abul-Badr.

Reign
When Muhammad's father died in 948, he succeeded him as the ruler of Shirvan, and appointed his son Ahmad as the ruler of Layzan, while his other son Haytham ibn Muhammad was appointed as the ruler of Tabarsaran. From 948 to 956, Muhammad constantly raided the territories of the non-Muslims, who are called "infidels" in Muslim sources.

Death
On 4 June 956, Muhammad died of small-pox. However, according to another source, he was poisoned by his vizier Ibn al-Maraghi. The reason for that was because, when Muhammad was suffering from small-pox, Ibn al-Maraghi used the opportunity to kill the imprisoned brother of Muhammad and had his body hidden. When Muhammad miraculously survived the illness, he ordered the release of his brother. Ibn al-Maraghi, who feared that his life was in danger, had Muhammad poisoned. His son Ahmad then succeeded Muhammad as the ruler of Shirvan.

Legacy
Writing in the first half of the 10th-century, the Arab historian and geographer al-Masudi reported that Muhammad II was "incontrovertibly" descended from the Sasanian monarch Bahram V Gur ((r. 420 – 438)), which demonstrates the early Persianization of the Shirvanshahs.