Battle of the Gates of Trajan The Battle of the Gates of Trajan ( , ) was a battle between Byzantine and Bulgarian forces in the year 986 . It took place in the pass of the same name , modern Trayanovi Vrata , in Sofia Province , Bulgaria . It was the largest defeat of the Byzantines under Emperor Basil II . After the unsuccessful siege of Sofia he retreated to Thrace , but was surrounded by the Bulgarian army under the command of Samuil in the Sredna Gora mountains . The Byzantine army was annihilated and Basil himself barely escaped . Fifteen years after the fall of the Bulgarian capital Preslav , the victory at the Gates of Trajan extended the Bulgarian successes achieved since 976 . Later on Tsar Samuil moved the capital from Preslav in the northeast to Ohrid in the southwest . The memory of the great victory over Basil II was preserved thirty years later in the Bitola inscription of Ivan Vladislav ( 1015 – 1018 ) , the son of Aron . Historical sources . In addition to the Bitola inscription where the victory of Samuil , commander of the Bulgarian army , is mentioned in summary form , several Medieval historians have written accounts for the battle . Among them were " Leo the Deacon " who was an eyewitness and a direct participant in the campaign ; " John Skylitzes " and two other historians " George Kedrin " and " John Zonaras " who repeat the work of Skylitzes . Not only Byzantine historians wrote accounts for the battle , it was also recorded by the Arab chronicler " Yahaya of Antioch " and the Armenians , " Stephen of Taron " ( also known as " Asolic " ) and " Matthew of Edessa " . More details can be found in the commended sermon of Saint Photius of Thessaly . Origins of the conflict . In 971 , the Byzantine emperor John Tzimiskes forced the captured Bulgarian emperor Boris II to abdicate and move to Constantinople following the fall of the Bulgarian capital Preslav . The Byzantines had occupied only the eastern parts of Bulgaria ; to the west , the four sons of the count of Sredets Nikola David , Moses , Samuil and Aron continued to rule western Bulgaria . They ruled the free territories in a tetrarchy residing in four separate cities in order to fight the Byzantines with higher efficiency . The war against Bulgaria was the first major undertaking carried out by Basil II after his ascension to the throne in 976 , although the Bulgarian attacks had begun in that year . One of the reasons for the ten years of inaction was the policy of one of the strongest nobles in Byzantium , Basil , who " de facto " ruled the Byzantine Empire in the first years of his namesake . During that time , the main objective of the government in Constantinople was to crush the rebellion of the military commander Bardas Skleros in Asia Minor between 976 and 979 . The local Byzantine governors were left alone to cope with the Bulgarian threat but they were unable to stop the Bulgarians . The positions of the brothers Samuil and Aron ( the two eldest brothers David and Moses died soon after the beginning of the great offensive in 976 ) were strengthened not only by the rebellion of Skleros but also the neglect of the former Byzantine Emperor John Tzimisces towards the southwestern Bulgarian lands . After the fall of Preslav and the north - eastern areas of the Bulgarian Empire his main priority became the war against the Arabs in Syria , which gave the Bulgarians time to prepare for a long struggle from the center of the remaining parts of the Empire around the Ohrid and Prespa Lake s . For one decade in offensive after 976 the Bulgarians achieved major successes . Samuil managed to liberate north - eastern Bulgaria . Between 982 and 986 the Bulgarians occupied the main city of Thessaly ( in modern Greece ) , Larissa . The constant Bulgarian attacks forced Basil II to take serious actions . Siege of Sredets . In 986 , Basil II led a campaign with 30 , 000 soldiers . The commanders of the eastern armies did not take part in the campaign because they were fighting with the Arabs . The Byzantines marched from Odrin via Plovdiv to reach Sredets ( Sofia ) . According to Leo Diaconus the objective of their Emperor was to subdue the Bulgarians with one strike . After the capture of Serdica which was a strategic fortress between the northeastern and southwestern Bulgarian lands Basil II intended to continue his campaign towards Samuil ' s main strongholds in Macedonia . On his way to Serdica ( the Byzantine name of Sredetz , today Sofia , the capital city of modern day Bulgaria ) , Basil II left a strong company under Leon Melissenos to guard the rear of the Byzantine army . When he finally reached the walls of the city , Basil II built a fortified camp and besieged the fortress . The siege lasted for 20 days of fruitless assaults , until shortage of food occurred in the Byzantine army . Their attempts to find provisions in the surrounding country were stopped by the Bulgarians who burned crops and even took the cattle of the Byzantines . In the end , the city garrison broke out of the walls , killing many enemy soldiers and burning all of the siege equipment , which the inexperienced Byzantine generals had placed too close to the city walls . The battle . As a result of the successful Bulgarian actions the Byzantines were no longer capable of taking the city with a direct assault . They also could not exhaust the defenders with hunger because , after their supplies were cut , the Byzantines themselves had to deal with that problem . In addition , an army led by Samuil marched into the mountains at the Byzantines ' rear . In the meantime , instead of securing the way for retreat , Leon Melissenos pulled back to Plovdiv . That action was an additional reason for Basil II to lift the siege . The commander of the Western armies , Kontostephanos , persuaded him that Melissenos had set off to Constantinople to take his throne . The Byzantine army retreated from the Sofia Valley towards Ihtiman where it stopped for the night . The rumours that the Bulgarians had barred the nearby mountain routes stirred commotion among the soldiers and on the following day the retreat continued in growing disorder . When the Bulgarians under Samuil and probably Roman saw that , they rushed to the enemy camp and the retreat turned to flight . The Byzantine advance guard managed to squeeze through slopes which were not yet taken by the Bulgarian attackers . The rest of the army was surrounded by the Bulgarians . Only the elite Armenian unit from the infantry managed to break out with heavy casualties and to lead their Emperor to safety through secondary routes . Enormous numbers of Byzantine soldiers perished in the battle ; the rest were captured along with the Imperial insignia . Aftermath . The disaster of the campaign in Bulgaria in 986 was a blow to the consolidation of the monocracy of Basil II . Soon after the Battle of the Gates of Trajan , the nobility in Asia Minor , led by the general Bardas Phokas , rebelled against Basil II for three years . According to the historian Petar Mutafchiev , after the battle Samuil was in control of the Balkans . According to some historians , the northeastern parts of the Bulgarian Empire were liberated in the years after the battle . However , according to other sources , they were liberated ten years prior to the battle , in 976 . The Bulgarians firmly took the initiative and launched continuous attacks towards Thessaloniki , Edessa , and the Adriatic coast . The Serbs were also defeated and their state incorporated into Bulgaria .