The first record of Stirling Castle dates from around 1110, when King Alexander I dedicated a chapel there. It appears to have been an established royal centre by this time, as Alexander died here in 1124. During the reign of his successor David I, Stirling became a royal burgh, and the castle an important administration centre. King William I formed a deer park to the south-west of the castle, but after his capture by the English in 1174, he was forced to surrender several castles, including Stirling and Edinburgh Castle, under the Treaty of Falaise. There is no evidence that the English actually occupied the castle, and it was formally handed back by Richard I of England in 1189. Stirling continued to be a favoured royal residence, with William himself dying there in 1214, and Alexander III laying out the New Park, for deer hunting, in the 1260s.