Malcolm was born in 1031, the son of king Duncan I of Scotland and his wife; a cousin of Siward, Earl of Northumberland. When his father was killed in 1040 Malcolm did not succeed to the throne. At the time the system alternated between different lines of the same royal family. So the king chosen from a different royal line was Macbeth, who had killed Duncan I in battle. Malcolm killed Macbeth in battle in 1057, but Lulach, MacBeth's stepson was selected as king. This broke the pattern of alternate selection. Lulach ruled only ruled a few months until he was killed. Malcolm finally succeeded Lulach and changed the succession to his own sons and their descendants. This made Scotland like other European countries in keeping the same dynasty on the throne.