The Bulgarian army under the command of Nestoritsa was defeated by the Byzantines led by the governor of Thessalonica Theophylactus Botaniates and it was unable to divert the main Byzantine forces who were attacking the Bulgarian ramparts between the Belasitsa and Ograzhden mountains .