In the 13th century, William de Valence founded the town wall, to protect medieval Pembroke. From the castle, it originally cut off the low rocky peninsula and was flanked by ten D-shaped towers and three gates.