The Seljuk brothers broke a much larger Ghaznavid army at Dandanaqan on 23 May 1040 after wearing it down for weeks without water or supplies; Tughril Beg was proclaimed ruler of Khurasan, and the Seljuk Empire dates from that day.
Dandanaqan was fought on 23 May 1040 at a caravan station on the waterless road between Sarakhs and Merv, and it transferred the richest province of the eastern Islamic world from one Turkish dynasty to another. The Ghaznavids had ruled Khurasan for two generations from Ghazna in what is now Afghanistan; the Seljuks were Oghuz Turkmen who had crossed the Oxus as migrants and mercenaries a decade earlier, and who had been raiding the province while refusing every offer of a pitched battle.
The victory made a nomadic confederation into a state. Tughril Beg was proclaimed ruler in Nishapur, and within fifteen years he had taken Baghdad and made the Abbasid caliph a client in his own capital. Alp Arslan, the son of the brother who commanded at Dandanaqan, would beat a Byzantine emperor at the Battle of Manzikert thirty-one years later and open Anatolia to Turkish settlement. The chain that ends in that battle begins on this road.
The Seljuks were the followers of the house of Seljuk, Oghuz Turks from the Aral steppes who adopted Sunni Islam around the turn of the millennium and drifted south into Transoxiana as pastoralists and hired soldiers. Mahmud of Ghazna had settled a body of them in Khurasan and then tried to break them when they proved ungovernable. By the 1030s Tughril, his brother Chaghri and their uncle Musa were operating in the province with thousands of horsemen, taking Nishapur in 1038 and being driven out again.
Mas'ud I inherited a formidable machine from his father Mahmud and spent it badly. His attention was on India, where campaigning paid; the Khurasanian cities wanted a garrison that could actually protect their trade; and his general Sübaşı was beaten by the Seljuks in 1039 at Sarakhs. By the spring of 1040 the sultan had concluded that the problem needed his own presence and his whole field army, and he marched from Herat with the elephants.
The Ghaznavid army was built for set-piece war: armoured cavalry, Indian elephants, a baggage train and the court that travelled with a sultan. The Seljuks were built to avoid exactly that, and they did. They shadowed the column across the sixty waterless miles between Sarakhs and Merv, burned the grazing in front of it, cut the supply line behind it and held the wells on the route. Men and horses arrived at Dandanaqan after days on short rations, in May heat, having been shot at without being able to close.
The Ghaznavid historian Abu'l-Fazl Bayhaqi, who served in Mas'ud's chancery and wrote the fullest account, describes an army already breaking before it fought: troops fighting each other over water, officers advising retreat and the sultan refusing it. The three days of fighting that followed were less a battle than the collapse of a force that could no longer feed itself, and the Ghaznavid cavalry began going over to the Seljuks in the middle of it.
The engagement opened on 22 May and was decided on the 23rd. Seljuk horse-archers worked the flanks of a line that could not reach them, and the Ghaznavid wings, sent out to drive them off, were drawn apart and cut up in detail. The elephant corps, which needed water above all, was useless in the dust; the cavalry of the right wing deserted with its commanders.
Mas'ud fought on foot when his horse was killed and then got away toward Ghazna with a hundred riders, the treasury and camp lost behind him. The Seljuk leaders divided what they had taken: Tughril took the title of sultan and the western lands, Chaghri took Merv and the east, and Musa took Herat and the south. Then they sent to the caliph in Baghdad to have the arrangement recognised.
Mas'ud did not survive the defeat politically. He gathered what remained and set out for India with the treasury; his own troops mutinied on the road early in 1041, put his blinded brother Muhammad on the throne, and killed him in prison. The dynasty held Ghazna and the Punjab for another century and a half and produced able rulers, but it was a power in Afghanistan and northern India from that point on, not in Iran.
For the cities of Khurasan the change was less catastrophic than the campaign had been. Nishapur, Merv and Herat had been fought over and requisitioned by both sides; the Seljuks, once they were a government rather than a raiding confederation, needed the tax revenue and the Persian administrative class that collected it. Within a generation the vizier Nizam al-Mulk was running an empire from Isfahan with Persian bureaucrats and endowed colleges, which is the shape Seljuk rule kept.
Dandanaqan is the reason the Seljuk Empire has a starting date. It converted a mobile confederation with no fixed territory into the ruling power of Khurasan, gave it the revenue of the Silk Road cities, and set it looking west. Tughril entered Baghdad in December 1055, ended the Shia Buyid protectorate over the Abbasid caliphs and was named sultan by the caliph himself — the settlement that gave the Sunni caliphate a Turkish military guardian for the rest of the Middle Ages.
It also started a migration. The Turkmen bands whose raiding had won the battle were not soldiers the new sultanate could easily pay or restrain, and their answer to that problem was to push them at the frontier with the Byzantines. That policy filled Armenia and then Anatolia with Turkish pastoralists in the decades after 1040, and it is the background to Manzikert, to the Sultanate of Rum and to the Anatolian beyliks from which the Ottomans later emerged.