Lancaster Castle was established in 1093 when Roger of Poitou was granted land by King William of Rufus following the capture of Calisle from Scottish forces. Roger placed his military headquarters in Lancaster near the site of the old Roman fort on the hill overlooking the River Lune, and the main road to Scotland at that time, running along the Cumbrian coast. Previous suggestions that it was Roger who built the keep are no longer the consensus view.
After William of Rufus' death, Roger supported Robert Duke of Normandy as the next king and so had his lands confiscated from him by Henry I in 1102. During the Anarchy, after Henry I's death, Stephen of Blois, crowned king in 1135, allowed King David of Scotland to occupy the Honour of Lancaster in 1141. By 1164, the Honour was brought back under the direct control of the king, by then Henry II. Until 1182, the County of Lancaster was administered together with Northumbria. The building of the keep is currently dated to the mid-12thc based on size and style, but no actual records of its building or who paid for it are known to survive.
Royal accounts show that King John spent more than £630 between 1209 and 1211 on building works at the Castle. He is thought to have built Adrian's tower in the S-W corner of the Castle.
After the Civil War and Restoration of Charles II, the N half of the keep was a roofless shell but the S half stayed in use as the Shire Hall until the building of the new Crown Court and Shire Hall at the end of the 18thc, completed at the beginning of the 19thc. The predecessor to the 1816 County Lunatic Asylum was beneath the old Shire Hall.