The county court for Northumberland was held at different times at Newcastle, Alnwick and Morpeth, until by statute of 1549 it was ordered that the court should thenceforth be held in the town and castle of Alnwick. Under the same statute the sheriffs of Northumberland, who had been in the habit of appropriating the issues of the county to their private use, were required thereafter to deliver in their accounts to the Exchequer in the same manner as the sheriffs of other counties. From the Norman Conquest until the union of England and Scotland under James I and VI, Northumberland was the scene of perpetual inroads and devastations by the Scots. Norham, Alnwick and Wark were captured by David I of Scotland in the wars of Stephen's reign. In 1174, during his invasion of Northumbria, William I of Scotland, also known as William the Lion, was captured by a party of about four hundred mounted knights, led by Ranulf de Glanvill. This incident became known as the Battle of Alnwick. In 1295, Robert de Ros and the earls of Athol and Menteith ravaged Redesdale, Coquetdale and Tynedale. In 1314 the county was ravaged by king Robert Bruce. And so dire was the Scottish threat in 1382, that by special enactment the earl of Northumberland was ordered to remain on his estates to protect the border. In 1388, Henry Percy was taken prisoner and 1500 of his men slain at the battle of Otterburn, immortalised in the ballad of Chevy Chase. Alnwick, Bamburgh and Dunstanburgh were garrisoned for the Lancastrian cause in 1462, but after the Yorkist victories of Hexham and Hedgley Moor in 1464, Alnwick and Dunstanburgh surrendered, and Bamburgh was taken by storm. In September 1513, King James IV of Scotland was killed at the Battle of Flodden on Branxton Moor. Roman Catholic support in Northumberland for Mary, Queen of Scots, led to the Rising of the North in 1569. After uniting the English and Scottish thrones, James VI and I sharply curbed the lawlessness of the border reivers and brought relative peace to the region. There were Church of Scotland congregations in Northumberland in the 17th and 18th centuries. During the Civil War of the 17th century, Newcastle was garrisoned for the king by the earl of Newcastle, but in 1644 it was captured by the Scots under the earl of Leven, and in 1646 Charles I was led there a captive under the charge of David Leslie.