Bankrupted by this hiatus, Kavad applied for subsidies from the Byzantine emperor Anastasius I. The Byzantines had originally paid the Iranians voluntarily to maintain the defense of the Caucasus against attacks from the north. Anastasius refused the subsidies, which led Kavad to invade his domains, thus starting the Anastasian War. Kavad first seized Theodosiopolis and Martyropolis respectively, and then Amida after holding the city under siege for three months. The two empires made peace in 506, with the Byzantines agreeing to pay subsidies to Kavad for the maintenance of the fortifications on the Caucasus in return for Amida. Around this time, Kavad also fought a lengthy war against his former allies, the Hephthalites; by 513 he had re-taken the region of Khorasan from them.