In VI - VII centuries the Aqqoyunlu tribes dwelled in the area between the Caucasus Major and the River Arax. Some of those tribes later settled in the east of the Asia Minor (Eastern Anatolia), Diyarbakir and Iraq. With the brave military leader and wise statesman Uzun Hassan`s ascention to power in 1453, the Aqqoyunlu tribal federation headquartered in Diyarbakir became mightier. In 1467, Uzun Hassan put an end to the Qaraqoyunlu state. In 1468, he occupied the entire territory of the Qaraqoyunlu state and moved his capital from Diyarbakir to Tabriz. As a result of his brilliant victories achieved within a short period, Uzun Hassan annexed the Azerbaijani lands south to the Kura and the Western Azerbaijan besides Diyarbakir, Kurdistan, a part of Georgia, including Tbilisi, a large part of Iran and Iraq. Uzun Hassan created a vast empire stretching from Khorasan to Karaman beyhood, on the Mediterranean coast.Under his leadership, the Aqqoyunlu Empire turned into one of the most powerful states of the Near and Middle East. After Uzun Hassan`s death, the Aqqoyunlu state eventually declined because of internal frictions. In 1499, it was divided into two. In 1501, it was replaced by the Safavid state established by Shah Ismail, grandson of Uzun Hassan.