In 1513, Robert Maxwell, 5th Lord Maxwell, was appointed keeper following the death of the previous keeper, John Dunbar of Mochrum, at Flodden. In 1526 the position was made hereditary to the Maxwells (later Earls of Nithsdale). In 1542, Robert Maxwell was captured after the battle of Solway Moss, and forced to hand Threave over to the English invaders. It was retrieved for Scotland by the Earl of Arran in 1545. The Catholic Maxwell family, based at Caerlaverock Castle, were often suspected of treachery as Scotland turned to Protestantism, and Lord Maxwell was required to surrender Threave temporarily as the Spanish Armada approached the English coast.