The first people known to have inhabited Central Asia were Iranian nomads who arrived from the northern grasslands of what is now Uzbekistan sometime in the first millennium BC. These nomads, who spoke Iranian dialects, settled in Central Asia and began to build an extensive irrigation system along the rivers of the region. At this time, cities such as Bukhara and Samarkand began to appear as centers of government and culture. By the 5th century BC, the Bactrian, Khwarazm, Soghdian, and Tokharian states dominated the region.