William the Lion
The castle was used as a royal residence by David I and William the Lion.