William, the illegitimate son of Robert, Duke of Normandy and Herleva of Falaise, was born in 1027. Instead of marrying Herleva, Robert persuaded her to marry his friend, Herluin of Conteville. After marriage, Herleva had two more sons, Odo of Bayeux and Robert of Mortain.
In 1035, Robert of Normandy went on a pilgrimage. Before setting out on his trip Robert he forced his lords to swear fealty to William. Although William was illegitimate, he was Robert's only living son.
When Robert of Normandy died in 1035 William inherited his father's title. Several leading Normans, including Gilbert of Brionne, Osbern the Seneschal and Alan of Brittany, became William's guardians.
A number of Norman barons would not accept an illegitimate son as their leader and in 1040 an attempt was made to kill William. The plot failed but they did manage to kill Gilbert of Brionne, Alan of Brittany and Osbern the Seneschal. William survived but he was forced to accept Ralph of Wacy as his guardian and leader of his armed forces. William was unhappy with this as Ralph had been involved in the plot against him and had been responsible for the murder of Gilbert of Brionne.
William began to govern Normandy in 1045. Two years later, the lords of the western region of the duchy rebelled, but William successfully defeated them at Val-es-dunes. In 1051 William visited Edward the Confessor, the king of England. Later, William claimed that Edward promised him that he would become his heir.
In 1053 William married Matilda of Flanders, the daughter of Count Baldwin of Flanders. Over the next sixteen years the couple had nine children. Robert Curthose, Richard (killed in a hunting accident in 1075), Cecily, William Rufus, Agatha, Henry Beauclerk and Adela.
William's power in Normandy was constantly under threat. In 1053 he suppressed a revolt led by William of Arques. After repulsing two French invasions, William eventually managed to capture Maine. At first the people of Maine were unwilling to accept William as their leader. In 1063 William's army ravaged the land until he received their submission.
In 1064 Harold of Wessex was on board a ship that was wrecked on the coast of Ponthieu. He was captured by Count Guy of Ponthieu and imprisoned at Beaurain. William, demanded that Count Guy release him into his care. Guy agreed and Harold went with William to Rouen. Later the two men went into battle against Conan of Brittany.
For his role in the capture of Dinan, Harold was knighted by William. During the ceremony at Bayeux, Harold took an oath that he would do his best to help William to become king when Edward the Confessor died. Harold also agreed to marry William's daughter, Eadmer. In return, William promised Harold half the realm of England.
In 1065 Edward the Confessor became very ill. Harold claimed that Edward promised him the throne just before he died on 5th January, 1066. The next day there was a meeting of the Witan to decide who would become the next king of England. The Witan was made up of a group of about sixty lords and bishops and they considered the merits of four main candidates: William, Harold, Edgar Etheling and Harald Hardrada.