Leo's first task was to deal with the Bulgarian situation, who now occupied most of Thrace and were blockading Constantinople. Eventually he was able to conclude a peace treaty in 815, to the long-running Byzantine–Bulgarian wars.