The city on the archaeological mound of Afrasiyab, just north-east of the modern town, was already an urban Sogdian capital when Alexander the Great sacked it in 329 BCE. He is reported to have called it Marakanda — the Greek rendering of the Sogdian Smarakanda, 'the stone town' — and married the Sogdian princess Roxana here two years later. For the next thousand years Samarkand was the caravan pivot of the eastern Silk Road, run by Sogdian merchants who wrote to their families in a script derived from Aramaic.
In 1220 Genghis Khan levelled Afrasiyab, killed most of its population and moved the city south-west to its present site — the Samarkand tourists visit today is essentially a Timurid rebuild. Timur (Tamerlane) made it his imperial capital in 1370 and imported craftsmen from Damascus, Isfahan, Delhi and Baghdad to build it. The Registan, Bibi-Khanym, Gur-e-Amir and Shah-i-Zinda are what he and his grandson Ulugh Beg left behind.
Ulugh Beg himself was one of the great astronomers of the medieval world. His observatory on Kuhak hill (1424–1429) held a 40-metre underground sextant with which he catalogued 1,018 stars and measured the length of the tropical year to within 25 seconds of the modern value — precision unmatched anywhere on Earth until Tycho Brahe 150 years later.