Bulgarian resistance revived under the rule of the Cometopuli dynasty, but the new Emperor Basil II () made the submission of the Bulgarians his primary goal. Basil's first expedition against Bulgaria, however, resulted in a defeat at the Gates of Trajan. For the next few years, the emperor was preoccupied with internal revolts in Anatolia, while the Bulgarians expanded their realm in the Balkans. The war dragged on for nearly twenty years. The Byzantine victories of Spercheios and Skopje decisively weakened the Bulgarian army, and in annual campaigns, Basil methodically reduced the Bulgarian strongholds. At the Battle of Kleidion in 1014 the Bulgarians were annihilated: their army was captured, and it is said that 99 out of every 100 men were blinded, with the hundredth man left with one eye so he could lead his compatriots home. When Tsar Samuil saw the broken remains of his once formidable army, he died of shock. By 1018, the last Bulgarian strongholds had surrendered, and the country became part of the Empire. This victory restored the Danube frontier, which had not been held since the days of the Emperor Heraclius.