After Simeon's death, Bulgaria was weakened by wars with Magyars and Pechenegs and the spread of the Bogomil heresy. Preslav was seized by the Byzantine army in 971 after consecutive Rus' and Byzantine invasions. The empire briefly recovered from the attacks under Samuil, but this ended when Byzantine emperor Basil II defeated the Bulgarian army at Klyuch in 1014. Samuil died shortly after the battle, and by 1018 the Byzantines had conquered the First Bulgarian Empire. After the conquest, Basil II prevented revolts by retaining the rule of local nobility, integrating them in Byzantine bureaucracy and aristocracy, and relieving their lands of the obligation to pay taxes in gold, allowing tax in kind instead. The Bulgarian Patriarchate was reduced to an archbishopric, but retained its autocephalous status and its dioceses.