Southern Azerbaijan has fertile soil and a pleasant climate and has for a long time been the destination of nomadic tribes. One such tribe was the Medes who are generally thought to be the ancestors of today’s Azerbaijanis. It is likely that Azerbaijani people settled on the Iranian mainland before any Persian tribes entered the area. A tribe of the Medes took control of the north-western part of Iran in what today comprises Azerbaijan in around the 6th Century BC. The Medes Empire ruled for 75 years before it became a part of the Persian Empire. The Asiatic Turks, the Seljuks, dominated the region in the 11th and early 12th centuries, and contributed much to the culture of the region. The Turkish influence and strong immigration into Persia placed Southern Azerbaijan at the centre of power in the country.
The Azerbaijani Turks established their first united empire in 1501 as the Great King Ismail Khatai declared the Safavid Empire in Tabriz in the year of 1505. The Safavid were replaced by Nadir Shah Avshar and created the Avshars Dynasty.
The Gajar (Qajar) dynasty was the last of the Turkish dynasties to rule Persia. Turkic states, such as the Gajar state, strongly affected the history of modern Azerbaijan. The Gajar dynasty ruled most parts of present day Iran, including Southern Azerbaijan, 1794-1925. During this time only men from the Azerbaijani people could claim right to the throne of the state of Gajar.
The undercurrent dynasty seems to have been to unite all land previously ruled by their ancestors, the moves led to long lasting wars between the Gajars and Russia, as Russia quested to seize Southern Caucasus.
Ultimately, these hostilities led to the division of Azerbaijan into a northern part ruled by Russia and a southern part ruled by the Gajar confederation, as agreed in the treaties of Gulustan (1813) and Turkmenchay (1828). Before the split the Azerbaijani boarders reached from what is today Derbet, the most southern city of Russia, to the province of Hamadan, south west of Tehran. During Russian rule of Northern Azerbaijan its territory decreased significantly, this later became the Republic of Azerbaijan.