 In 1623, the electoral vote previously held by the Palatinate was transferred to Bavaria, giving the Wittelsbachs control of two votes.However, depriving Frederick of his inheritance changed the nature and extent of the war, drawing in foreign powers.In 1625, the Protestant Christian IV of Denmark invaded Northern Germany but after some success, was defeated by the Imperial general Wallenstein and forced to withdraw in 1629.