Balvenie Castle was built in the thirteenth century by the Comyn Earls of Buchan and visited by King Edward 1 of England. It was retained by the Stewarts, Earls of Atholl, from 1459 to the seventeenth century. In 1562 Mary Queen of Scots spent two nights at the castle on her northern campaign against the Gordons; it gave refuge to the Marquis of Montrose in 1644 and was stormed by the Royalists in 1649. In 1689, after the Battle of Killiecrankie, victorious Jacobites occupied it. The castle was last occupied by government forces in 1746.