Bulgarian resistance revived under the leadership of the Cometopuli dynasty, but the new emperor Basil II (reigned 976–1025 AD) made the submission of the Bulgarians his primary goal. Basil's first expedition against Bulgaria however resulted in a humiliating defeat at the Gates of Trajan. For the next few years, the emperor would be preoccupied with internal revolts in Anatolia, while the Bulgarians expanded their realm in the Balkans. The war was to drag 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. Eventually, at the Battle of Kleidion in 1014 the Bulgarians were completely defeated. The Bulgarian army was captured, and it is said that 99 out of every 100 men were blinded, with the remaining hundredth man left with one eye so as to lead his compatriots home. When Tsar Samuil saw the broken remains of his once gallant army, he died of shock. By 1018, the last Bulgarian strongholds had surrendered, and the country became part of the empire. This epic victory restored the Danube frontier, which had not been held since the days of the emperor Heraclius.