It is thought that the rapid extension of Bulgars over Slavs to the south prompted the Serbs to unite into a state. It is known that the Serbs and Bulgars lived in peace until the invasion in 839 (the last years of Theophilos). Vlastimir united several Serbian tribes, Emperor Theophilos (r. 829–842) probably granted the Serbs independence, and they acknowledged nominal overlordship of the Emperor. The annexation of western Macedonia by the Bulgars changed the political situation, Malamir or Presian may have seen a threat in the Serb consolidation, and opted to include them in their conquest of Slav lands.