henry was the eldest son of the emperor henry iii, by his second wife agnes de poitou, and was probably born at the royal palace at goslar. when henry iii unexpectedly died in 1056, the six-year-old henry iv became king without problems. the empress agnes acted as regent, and the german pope victor ii was named as her counsellor.