Carlisle is a historic city and the county town of Cumbria as well as the administrative centre of the City of Carlisle district in North West England. Carlisle is located at the confluence of the rivers Eden, Caldew and Petteril, 10 miles south of the Scottish border. The early history of Carlisle is marked by its status as a Roman settlement, established to serve the forts on Hadrian's Wall. During the Middle Ages, because of its proximity to the Kingdom of Scotland, Carlisle became an important military stronghold; Carlisle Castle, still relatively intact, was built in 1092 by William Rufus, and once served as a prison for Mary, Queen of Scots. The castle now houses the Duke of Lancaster's Regiment and the Border Regiment Museum. In the early 12th century, Henry I allowed the foundation of a priory in Carlisle. The town gained the status of a city when its diocese was formed in 1133, and the priory became Carlisle Cathedral.