the turmoil to expand its political influence and commercial relationships, first with the Khazars and later with the Rus' and other steppe groups. The Byzantines established the Theme of Cherson, formally known as Klimata, in the Crimea in the 830s to defend against raids by the Rus' and to protect vital grain shipments supplying Constantinople. Cherson also served as a key diplomatic link with the Khazars and others on the steppe, and it became the centre of Black Sea commerce. The Byzantines also helped the Khazars build a fortress at Sarkel on the Don river to protect their northwest frontier against incursions by the Turkic migrants and the Rus', and to control caravan trade routes and the portage between the Don and Volga rivers. The expansion of the Rus' put further military and economic pressure on the Khazars, depriving them of territory, tributaries and trade. In around 890, Oleg waged an indecisive war in the lands of the lower Dniester and Dnieper rivers with the Tivertsi and the Ulichs, who were likely acting as vassals of the Magyars, blocking Rus' access to the Black Sea. In 894, the Magyars and Pechenegs were drawn into the wars between the Byzantines and the Bulgarian Empire. The Byzantines arranged for the Magyars to attack Bulgarian territory from the north, and Bulgaria in turn persuaded the Pechenegs to attack the Magyars from their rear. Boxed in, the Magyars were forced to migrate further west across the Carpathian Mountains into the Hungarian plain, depriving the Khazars of an important ally and a buffer from the Rus'. The migration of the Magyars allowed Rus' access to the Black Sea, and they soon launched excursions into Khazar territory along the sea coast, up the Don river, and into the lower Volga region. The Rus' were raiding and plundering into the Caspian Sea region from 864, with the first large-scale expedition in 913, when they extensively raided Baku, Gilan, Mazandaran and penetrated into the Caucasus. As the 10th century progressed, the Khazars were no longer able to command tribute from the Volga Bulgars, and their relationship with the Byzantines deteriorated, as Byzantium increasingly allied with the Pechenegs against them. The Pechenegs were thus secure to raid the lands of the Khazars from their base between the Volga and Don rivers, allowing them to expand to the west. Rus' relations with the Pechenegs were complex, as the groups alternately