According to Constantine VII, the Serbs and Bulgarian state had lived peacefully as neighbours until the invasion in 839 (in the last years of Theophilos). It is not known what exactly prompted the war, as Porphyrogenitus gives no clear answer; whether it was a result of Serbian-Bulgarian relations, "i.e.", the Bulgar conquest to the southeast, or a result of the Byzantine-Bulgarian rivalry, in which Serbia was an Imperial ally. It was not unlikely that the Emperor had a part in it; as he was at war with the Arabs, he may have pushed the Serbs to drive the Bulgaria from western Macedonia, which would benefit them both. According to J. Bury, this alliance would explain Malamir's action. Zlatarski supposes that the Emperor offered the Serbs complete independence in return.