Although individual Turkish generals had already gained considerable, and at times decisive, power in Mesopotamia and Egypt during the tenth and eleventh centuries, the coming of the Seljuks signaled the first large-scale penetration of the Turkish elements into the Middle East. Descended from a tribal chief named Seljuk, whose homeland lay beyond the Oxus River near the Aral Sea, the Seljuks not only developed a highly effective fighting force but also, through their close contacts with Persian court life in Khorasan and Transoxania, attracted a body of able administrators. Extending from Central Asia to the Byzantine marches in Asia Minor, the Seljuk state under its first three sultans- Tughril Beg, Alp-Arslan, and Malikshah- established a highly cohesive, well-administered Sunni state under the nominal authority of the 'Abbasid caliphs at Baghdad.
One of the administrators, the Persian Nizam-al-Mulk, became one of the greatest statesmen of medieval Islam. For twenty years, especially during the rule of Sultan Malikshah, he was the true custodian of the Seljuk state. In addition to having administrative abilities, he was an accomplished stylist whose book on statecraft, Siyasat-Namah, is a valuable source for the political thought of the time. In it he stresses the responsibilities of the ruler: for example, if a man is killed because a bridge is in disrepair, it is the fault of the ruler, for he should make it his business to apprise himself of the smallest negligences of his underlings. Nizam-al-Mulk, furthermore, was a devout and orthodox Muslim who established a system of madrasahs or theological seminaries (called nizamiyah after the first element of his name) to provide students with free education in the religious sciences of Islam, as well as in the most advanced scientific and philosophical thought of the time. The famous theologian al-Ghazali whose greatest work, the Revival of the Sciences of Religion, was a triumph of Sunni theology taught for a time at the nizamiyah schools at Baghdad and at Nishapur. Nizam-al-Mulk was the patron of the poet and astronomer 'Umar al-Khayyam (Omar Khayyam), whose verses, as translated by Edward FitzGerald in the nineteenth century, have become as familiar to English readers as the sonnets of Shakespeare.
After the death of Malikshah in 1092, internal conflict among the young heirs led to the fragmentation of the Seljuks' central authority into smaller Seljuk states led by various members of the family, and still smaller units led by regional chieftains, no one of whom was able to unite the Muslim world as still another force appeared in the Middle East: the Crusaders.