in 1680 the archbishopric of magdeburg was converted into a duchy and given to the margraves of brandenburg which ruled it in personal union with their other territories including the kingdom of prussia. it was briefly annexed by the kingdom of westphalia but returned to and annexed by prussia after napoleon's defeat.