Caerphilly Castle was built in the second half of the 13th century, as part of the Anglo-Norman expansion into South Wales. The Normans began to make incursions into Wales from the late 1060s onwards, pushing westwards from their bases in recently occupied England. Their advance was marked by the construction of castles and the creation of regional lordships. The task of subduing the region of Glamorgan was given to the earls of Gloucester in 1093; efforts continued throughout the 12th and early 13th centuries, accompanied by extensive fighting between the Anglo-Norman lords and local Welsh rulers. The powerful de Clare family acquired the earldom in 1217 and continued to attempt to conquer the whole of the Glamorgan region.