 Loch Leven Castle was strengthened in the 14th or early 15th century , by the addition of the five @-@ storey tower house or keep . According to Historic Scotland , it is of the 14th century , making it one of the oldest tower houses in Scotland which still substantially survives . In 1390 King Robert II ( reigned 1371 – 1390 ) granted the castle to Sir Henry Douglas , the husband of his niece Marjory . From the 14th century , the castle served as a state prison . Prior to becoming king , Robert II was held here in 1369 , as was Archibald Douglas , 5th Earl of Douglas ( d . 1439 ) in the first half of the 15th century . Patrick Graham , Archbishop of St Andrews , died in captivity at the castle in 1478 . 
