In his early years Samuel managed to inflict several major defeats on the Byzantines and to launch offensive campaigns into their territory. In the late 10th century, the Bulgarian armies conquered the Serb principality of Duklja and led campaigns against the Kingdoms of Croatia and Hungary. But from 1001, he was forced mainly to defend the Empire against the superior Byzantine armies. Samuel died of a heart attack on 6 October 1014, two months after the catastrophic battle of Kleidion. His successors failed to organize a resistance, and in 1018, four years after Samuel's death, the country capitulated, ending the five decades-long Byzantine–Bulgarian conflict.