During the 11th century, the county of Herefordshire was subject to attacks from Wales. Rather than repairing the town defences of Hereford, the county town, Ralph (son of the Count of Vexin) chose to build a castle within the settlement's defences. Ralph was made Earl of Hereford in about 1046; the date of the castle's foundation is uncertain, but it was present by 1052. This first castle is thought to have occupied the area of the later castle, in the east of the town. The areas to the north and west were densely occupied, and to the south was the River Wye. In 1055, the town and castle of Hereford were sacked by the Welsh. The "Anglo-Saxon Chronicle" recorded the incident: