From the early 14th century, Melbourne Castle was mainly in the possession of the Earls and Dukes of Lancaster or the crown. Improvements and repairs were made, particularly by John of Gaunt, and the building was in generally good condition throughout the fifteenth and early sixteenth centuries. John I, Duke of Bourbon, was kept at Melbourne for 19 years after his capture at the Battle of Agincourt in 1415, and the castle was considered as a possible prison for Mary, Queen of Scots, although events led to her incarceration elsewhere.