Carlisle is a city and the county town of Cumbria. Historically in Cumberland, it is also the administrative centre of the City of Carlisle borough in North West England. Carlisle is located at the confluence of the rivers Eden, Caldew and Petteril, 10 miles (16 km) south of the Scottish border. It is the largest settlement in the county of Cumbria, and serves as the administrative centre for both Carlisle City Council and Cumbria County Council. At the time of the 2001 census, the population of Carlisle was 71,773, with 100,734 living in the wider city. Ten years later, at the 2011 census, the city's population had risen to 75,306, with 107,524 in the wider city.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 diocese in 1122, and the priory became Carlisle Cathedral.