Warfare in Medieval Scotland includes all military activity in the modern borders of Scotland, or by forces originating in the region, between the departure of the Romans in the fifth century and the adoption of the innovations of the Renaissance in the early sixteenth century. In this period conflict developed from minor raids to major conflicts, incorporating many of the innovations of continental warfare.
In the Early Middle Ages war on land was characterised by the use of small war-bands of household troops often engaging in raids and low level warfare. The arrival of the Vikings brought a new scale of naval warfare, with rapid movement based around the Viking longship. The birlinn, which developed from the longship, became a major factor in warfare in the Highlands and Islands. By the High Middle Ages, the kings of Scotland could command forces of tens of thousands of men for short periods as part of the "common army", mainly of poorly armoured spearmen and bowmen. After the "Davidian Revolution" of the twelfth century, which introduced elements of feudalism to Scotland, these forces were augmented by small numbers of mounted and heavily armoured knights. Feudalism also introduced castles into the country, originally simple wooden motte-and-bailey constructions, but these were replaced in the thirteenth century with more formidable stone "enceinte" castles, with high encircling walls. In the thirteenth century the threat of Scandinavian naval power subsided and the kings of Scotland were able to use naval forces to help subdue the Highlands and Islands.
Scottish field armies rarely managed to stand up to the usually larger and more professional armies produced by England, but they were used to good effect by Robert I of Scotland at the Battle of Bannockburn in 1314 to secure Scottish independence. He adopted a policy of slighting castles and made use of naval power to support his forces, beginning to develop a royal Scottish naval force. In the Late Middle Ages under the Stewart kings these forces were further augmented by specialist troops, particularly men-at-arms and archers, hired by bonds of manrent, similar to English indentures of the same period. New "livery and maintenance" castles were built to house these troops and castles began to be adapted to accommodate gunpowder weapons. The Stewarts also adopted major innovations in continental warfare, such as longer pikes, the extensive use of artillery, and they built up a formidable navy. However, one of the best armed and largest Scottish armies ever assembled still met with defeat at the hands of an English army at the Battle of Flodden in 1513, which saw the destruction of a large number of ordinary troops, a large section of the nobility and King James IV.