The Seljuq dynasty, or Seljuqs (// SEL-juuk; Persian: آل سلجوق Al-e Saljuq), was an Oghuz Turk Sunni Muslim dynasty that gradually became a Persianate society and contributed to the Turco-Persian tradition in the medieval West and Central Asia. The Seljuqs established both the Seljuk Empire and Sultanate of Rum, which at their heights stretched from Anatolia through Iran and were targets of the First Crusade.
The Seljuqs originated from the Qynyk branch of the Oghuz Turks, who in the 9th century lived on the periphery of the Muslim world, north of the Caspian Sea and Aral Sea in their Yabghu Khaganate of the Oghuz confederacy, in the Kazakh Steppe of Turkestan. During the 10th century, due to various events, the Oghuz had come into close contact with Muslim cities.
When Seljuq, the leader of the Seljuq clan, had a falling out with Yabghu, the supreme chieftain of the Oghuz, he split his clan off from the bulk of the Tokuz-Oghuz and set up camp on the west bank of the lower Syr Darya. Around 985, Seljuq converted to Islam. In the 11th century the Seljuqs migrated from their ancestral homelands into mainland Persia, in the province of Khurasan, where they encountered the Ghaznavid empire. In 1025, 40,000 families of Oghuz Turks migrated to the area of Caucasian Albania. The Seljuqs defeated the Ghaznavids at the Battle of Nasa plains in 1035. Tughril, Chaghri, and Yabghu received the insignias of governor, grants of land, and were given the title of dehqan. At the Battle of Dandanaqan they defeated a Ghaznavid army, and after a successful siege of Isfahan by Tughril in 1050/51, they established an empire later called the Great Seljuk Empire. The Seljuqs mixed with the local population and adopted the Persian culture and Persian language in the following decades.
After arriving in Persia, the Seljuqs adopted the Persian culture and used the Persian language as the official language of the government, and played an important role in the development of the Turko-Persian tradition which features "Persian culture patronized by Turkic rulers." Today, they are remembered as great patrons of Persian culture, art, literature, and language. They are regarded as the partial ancestors of the Western Turks – the present-day inhabitants of the Republic of Azerbaijan (historically known as Shirvan and Arran), Azerbaijan (historic Azerbaijan, also known as Iranian Azerbaijan), Turkmenistan, and Turkey.
The "Great Seljuqs" were heads of the family; in theory their authority extended over all the other Seljuq lines, although in practice this often was not the case. Turkish custom called for the senior member of the family to be the Great Seljuq, although usually the position was associated with the ruler of western Persia.
In 1194, Tugrul III was killed in battle with the Khwarezm Shah, who annexed Hamadan.