Cardiff Castle is a medieval castle and Victorian Gothic revival mansion in the city centre of Cardiff, Wales. Norman invaders built the original motte and bailey castle in the late 11th century on top of a 3rd-century Roman fort. The castle was commissioned by either William the Conqueror or Robert Fitzhamon and formed the heart of the medieval town of Cardiff and the Marcher Lord territory of Glamorgan. In the 12th century, the castle began to be rebuilt in stone, probably by Robert of Gloucester, with a shell keep and substantial defensive walls being erected. The 6th Earl of Gloucester conducted further work in the second half of the 13th century. Cardiff Castle was repeatedly involved in the conflicts between the Anglo-Normans and the Welsh, being attacked several times in the 12th century and stormed in 1404 during the revolt of Owain Glyndŵr.