Urquhart was built as a royal castle in the early 13th century to control the whole upper part of the Great Glen and witnessed a good deal of warlike activity. It figured prominently in the Scots' struggle for independence in the 14th century. In the 15th and 16th centuries the castle was repeatedly raided and plundered, chiefly by the MacDonald lords of the Isles. The castle was last inhabited by government troops during the Jacobite troubles in the 1690s. When the redcoats marched out, it is said they blew up the gatehouse to render the castle useless to the enemy. The castle's main role since has been to serve the local community as a convenient quarry, which explains why so much of the structure is gone.