# Mahmud of Ghazni crosses the Oxus and allies with Qadir Khan (September 1024 – 29 April 1025)

URL: https://allhistories.com/tajikistan/timeline/1024-mahmud-of-ghazni-crosses-the-oxus-and-allies-with-qadir-khan
Location: Oxus crossing, between Termez and Samarkand
Themes: Ghaznavids, Karakhanids

In September 1024 the Ghaznavid sultan Mahmud crossed the Oxus with a large army, reportedly including hundreds of elephants, and advanced on Samarkand. On 29 April 1025 he sealed an alliance with the Karakhanid ruler Qadir Khan Yusuf, cemented by a double marriage between their families. Local vassals from Chaghaniyan, north of the river, joined him. The immediate cause was the rivalry between Qadir Khan and his brother Ali-Tegin, who ruled Bukhara and Samarkand. Ali-Tegin fled the advance, and Mahmud preferred to back a more cooperative Karakhanid partner. Chaghaniyan, the fertile valley between Denov and Termez, had once been a Samanid vassal state and now owed allegiance to Ghazna. Ali-Tegin recaptured Samarkand soon afterward, and in 1026 a Ghaznavid general helped Qadir Khan defeat him again. The episode confirmed the Oxus frontier and showed how the Hisor and Chaghaniyan borderlands, today partly in southern Tajikistan, were drawn into the politics of both courts. Sources give 1024 for the crossing, while some accounts say 1025. At this point in the timeline (1024), Transoxiana was held by the early Karakhanid khans, among them Nasr b. Ali (999 – 1040 CE). Other contemporary rulers included Mahmud of Ghazni, sultan of Ghazna (998 – 1030 CE). The main location of this event lies outside present-day Tajikistan.

## Why it matters
It shows how southern Tajik valleys such as Chaghaniyan and Tokharistan were pulled between Ghaznavid and Karakhanid power during the generation after the Samanid collapse.

Ruler at the Time: [Karakhanid khans of Transoxiana, 999-1040 (interim)](https://allhistories.com/tajikistan/rulers/karakhanid-khans-of-transoxiana-999-1040-interim)

## Sources
- [Wikipedia — Mahmud of Ghazni](https://en.wikipedia.org/wiki/Mahmud_of_Ghazni)
- [Wikipedia — Chaghaniyan](https://en.wikipedia.org/wiki/Chaghaniyan)

