The site at the confluence of the Ardoch Burn and the River Teith had been fortified by the Romans in the 1st century AD, although no remains are visible above ground. Ramparts and ditches to the south of the present castle may be the site of an earlier fortification, as the name Doune, derived from Gaelic dùn, meaning "fort", suggests. The earliest identifiable work in the castle dates from the thirteenth century, but it assumed its present form during one of the most creative and productive periods of Scottish medieval architecture, between 1375 and 1425, when numerous castles were being built and remodelled, including Dirleton and Tantallon in Lothian, and Bothwell in Lanarkshire.
In 1361, Robert Stewart (c.1340–1420), son of King Robert II (reigned 1371–1390), and brother of King Robert III (reigned 1390–1406), was created Earl of Menteith, and was granted the lands on which Doune Castle now stands. Building may have started any time after this, and the castle was at least partially complete in 1381, when a charter was sealed here. Robert was appointed Regent in 1388 for his elderly father, and continued to hold effective power during the reign of his infirm brother. He was created Duke of Albany in 1398. In 1406, Robert III's successor, James I, was captured by the English, and Albany became Regent once more. After this time, the number of charters issued at Doune suggest that the castle became a favoured residence.
Albany died in 1420, and Doune, the dukedom of Albany, and the Regency all passed to his son Murdoch (1362–1425). The ransom for James I was finally paid to the English, and the King returned in 1424, taking immediate steps to gain control of his kingdom. Albany and two of his sons were imprisoned for treason, and then executed in May 1425. Doune Castle became a royal possession, under an appointed Captain, or Keeper, and served as a retreat and hunting lodge for the Scottish monarchs. It was also used as a dower house by Mary of Guelders (c.1434–1463), Margaret of Denmark (1456–1486), and Margaret Tudor (1489–1541), the widowed consorts of James II, James III and James IV respectively.
In 1528, Margaret Tudor, now Regent of Scotland for her infant son James V, married Henry Stewart, 1st Lord Methven, a descendant of Albany. His brother, Sir James Stewart (c.1513–1554), was made Captain of Doune Castle, and Sir James' son, also James (c.1529–1590), was created Lord Doune in 1570. Lord Doune's son, another James (c.1565–1592), married Elizabeth Stuart, 2nd Countess of Moray around 1580, becoming Earl of Moray himself. The castle thus came to be the seat of its keepers, the Earls of Moray, who owned it until the 20th century.
Mary, Queen of Scots, (reigned 1542–1567) stayed at Doune on several occasions, occupying the suite of rooms above the kitchen. Doune was held by forces loyal to Mary during the brief civil war which followed her forced abdication in 1567, but the garrison surrendered to the Regent, Matthew Stewart, 4th Earl of Lennox, in 1570, after a three-day blockade. George Buchanan and Duncan Nairn, Deputy Sherriff of Stirling presided over the torture and interrogation of a messenger, John Moon, at Doune on 4 October 1570. Moon was carrying letters to Mary, Queen of Scots and Mary Seton.
King James VI visited Doune on occasion, and in 1581 authorised £300 to be spent on repairs and improvements, the works being carried out by the master mason Michael Ewing under the supervision of Robert Drummond of Carnock, Master of Work to the Crown of Scotland. In 1593, a plot against James was discovered, and the King surprised the conspirators, who included the Earls of Montrose and Gowrie, at Doune Castle.
In 1607, the minister, John Munro of Tain, a dissenter against the religious plans of James VI, was imprisoned with a fellow minister at Doune, though he escaped with the contrivance of the then Constable of the Castle, who was subsequently imprisoned for aiding the dissenters. The Royalist James Graham, 1st Marquess of Montrose occupied Doune Castle in 1645, during the Wars of the Three Kingdoms. In 1654, during Glencairn's rising against the occupation of Scotland by Oliver Cromwell, a skirmish took place at Doune between Royalists under Sir Mungo Murray, and Cromwellian troops under Major Tobias Bridge. The castle was garrisoned by government troops during the Jacobite Rising of Bonnie Dundee in 1689, when repairs were ordered, and again during the rising of 1715. During the Jacobite Rising of 1745, Doune Castle was occupied by Charles Edward Stuart, "Bonnie Prince Charlie", and his Jacobite Highlanders. It was used as a prison for government troops captured at the Battle of Falkirk. Several prisoners, held in the rooms above the kitchen, escaped by knotting together bedsheets and climbing from the window. Escapees included the author John Home, and a minister, John Witherspoon, who later moved to the American colonies and became a signatory of the United States Declaration of Independence.
The castle deteriorated through the 18th century, and by 1800 Doune was a roofless ruin. It remained so until the 1880s, when George Stuart, 14th Earl of Moray (1816–1895) began repair works. The timber roofs were replaced, and the interiors, including the panelling in the Lord's Hall, were installed. The castle is now maintained by Historic Scotland, having been donated to a predecessor organisation by Douglas Stuart, 20th Earl of Moray, in 1984, and is open to the public. The castle is a Scheduled Ancient Monument, and is a Category A listed building, the highest levels of protection for nationally important built heritage in Scotland.
Doune occupies a strategic site, close to the geographical centre of Scotland, and only 5 miles (8.0 km) from Stirling Castle, the "crossroads of Scotland". The site is naturally defended on three sides by steeply-sloping ground, and by the two rivers to east and west. The castle forms an irregular pentagon in plan, with buildings along the north and north-west sides enclosing a courtyard. It is entered from the north via a passage beneath a tower containing the principal rooms of the castle. From the courtyard, three sets of stone external stairs, which may be later additions, lead up to the Lord's Hall in the tower, to the adjacent Great Hall, and to the kitchens in a second tower to the west.
The main approach, from the north, is defended by earthworks, comprising three ditches, with a rampart, or earthen wall, between. Also outside the castle walls is a vaulted passage, traditionally said to lead into the castle, but in fact accessing an 18th-century ice house. There are no openings within the lower part of the castle's walls, excepting the entrance and the postern, or side gate, to the west, although there are relatively large windows on the upper storeys. Windows in the south wall suggest that further buildings were intended within the courtyard, but were never built. The stonework is of coursed sandstone rubble, with dressings in lighter Ballengeich stone.
The principal tower, or gatehouse, is rectangular in plan 18 metres (59 ft) by 13 metres (43 ft), and almost 29 metres (95 ft) high, with a projecting round tower on the north-east corner, beside the entrance. It comprises the Lord's Hall, and three storeys of chambers above, located over the entrance passage. The vaulted, cobbled passage, 14 metres (46 ft) long, was formerly defended by two sets of timber doors, and a yett, or hinged iron grille, remains. Guardrooms on either side overlook the passage via gunloops, and also on the ground floor is a well, in the basement of the round tower.
There is no direct communication between the ground floor and the Lord's Hall above, which occupies the whole first floor. This is accessed via an enclosed and gated stair from the courtyard. The hall is vaulted, and has an unusual double fireplace. The floor tiles, timber panelling, and minstrels' gallery are additions of the 1880s. It was originally thought that the connecting door to the Great Hall was also of this date, but is now accepted as being original. Side rooms on the hall level include a chamber in the round tower, with a hatch above the well, and a small chamber within the south wall which overlooks both hall and courtyard. A machicolation, or "murder hole", below the hall's north window, allows objects to be dropped onto attackers in the passage.
Above the hall is a second hall, forming part of the Duchess' suite of rooms. An oratory in the south wall, overlooking the courtyard, contains a piscina and credence niche. The oratory gives access to mural passages leading to the walkway along the curtain wall. The timber ceiling of the Duchess' hall, and the timber floors and roof above, are of the 1880s. The upper parts of the stonework are among the repairs dating from 1580.
West of the Lord's tower is the Great Hall, 20 metres (66 ft) by 8 metres (26 ft), and 12 metres (39 ft) high to its timber roof, again a 19th-century replacement. The hall has no fireplace, and was presumably heated by a central fire, and ventilated by means of a louvre like the one in the modern roof. No details of the original roof construction are known, however, and the restoration is conjectural. Large windows light the hall, and stairs lead down to the three cellars on ground level.
The hall is accessed from the courtyard via a stair up to a triangular lobby, which in turn links the hall and kitchens by means of two large serving hatches with elliptical arches, unusual for this period. The kitchen tower, virtually a tower house in its own right, is 17 metres (56 ft) by 8 metres (26 ft). The vaulted kitchen is on the hall level, above a cellar. One of the best-appointed castle kitchens in Scotland of its date, it has an oven and a 5.5-metre (18 ft) wide fireplace. A stair turret, added in 1581 and possibly replacing a timber stair, leads up from the lobby to two storeys of guest rooms. These include the "Royal Apartments", a suite of two bedrooms plus an audience chamber, suitable for royal visitors.
Projecting stones on the south wall of the kitchen block, known as tuskings, and four pointed-arched windows in the south curtain wall, suggest that further ranges of buildings were planned. The large, eastern-most window, may have been intended for a chapel, and it is recorded that a chapel dedicated to the 8th-century monk Saint Fillan was located at Doune Castle, but the lack of foundations suggest that there was no large building in this part of the castle. The foundations which do exist were excavated in September 2002, revealing a structure which was interpreted as a kiln or oven against the south wall. The central well is around 18 metres (59 ft) deep.
The curtain wall is 2 metres (6.6 ft) thick, and 12 metres (39 ft) high. A walkway along the top of the wall is protected by parapets on both sides, and is carried over the pitched roofs of the hall and gatehouse by steep steps. Open, round turrets are located at each corner, with semicircular projections at the midpoint of each wall. A square turret with machicolations is located above the postern gate in the west wall.
The Lord's tower is a secure, private set of rooms, probably intended for the sole use of the Lord and his family, and with its own lines of defence. The architectural historian W. Douglas Simpson interpreted this arrangement as being the product of the "bastard feudalism" of the 14th century. During this period, Lords were required to defend their castles by means of mercenaries, rather than the vassals of the earlier feudal system, and Simpson suggested that the Lord of Doune designed his tower to be defensible against his own, potentially rebellious, garrison. This interpretation is no longer widely accepted by historians, and the castle is instead seen as a development towards more integrated courtyard buildings, such as the royal palace of Linlithgow, which was constructed through the 15th and early 16th century. The layout of Doune has similarities with those of the contemporary castles at Tantallon and Bothwell, and appears, at various scales, in other buildings of the period.
Doune Castle has featured in several literary works, including the 17th-century ballad, "The Bonny Earl of Murray", which relates the murder of James Stewart, 2nd Earl of Moray, by the Earl of Huntly, in 1592. In Sir Walter Scott's first novel, Waverley (1814), the protagonist Edward Waverley is brought to Doune Castle by the Jacobites. Scott's romantic novel describes the "gloomy yet picturesque structure", with its "half-ruined turrets".
The castle was used as a location in MGM's 1952 historical film Ivanhoe which featured Robert Taylor and Elizabeth Taylor. The BBC adaptation of "Ivanhoe" in 1996 also featured Doune as a location. The castle was used as the set for Winterfell in the TV series Game of Thrones (2011–present), an adaptation of the A Song of Ice and Fire series of novels by George R. R. Martin. The castle was used as a stand-in for the fictional "Castle Leoch" in the TV adaptation of the Outlander series of novels.
The British comedy film Monty Python and the Holy Grail — a parody of the legends of King Arthur by the Monty Python team — was filmed on location in Scotland in 1974. The film's producers had gained permission from the National Trust for Scotland to film scenes at several of their Scottish castles, as well as the permission of Lord Moray to film at Doune Castle. However, the National Trust later withdrew their permission, leaving the producers with little time to find new locations. Instead, they decided to use different parts of Doune Castle to depict the various fictional castles in the film, relying on tight framing of shots to maintain the illusion.
Scenes featuring Doune Castle include:At the start of the film, King Arthur (Graham Chapman) and Patsy (Terry Gilliam) approach the east wall of Doune Castle and argue with soldiers of the garrison.
The song and dance routine "Knights of the Round Table" at "Camelot" was filmed in the Great Hall.
The servery and kitchen appear as "Castle Anthrax", where Sir Galahad the Chaste (Michael Palin) is chased by seductive girls.
The wedding disrupted by Sir Lancelot (John Cleese) was filmed in the courtyard and Great Hall.
The Trojan Rabbit scene was filmed in the entryway and into the courtyard.
The only other castles used for filming were Castle Stalker in Argyll, also privately owned, which appears as "Castle Aaaaarrrrrrggghhh" at the end of the film, and (briefly) Kidwelly Castle in Wales. The DVD version of Monty Python and the Holy Grail includes a documentary, In Search of the Holy Grail Filming Locations, in which Michael Palin and Terry Jones revisit Doune and other sites used for filming. Doune Castle has become a place of pilgrimage for fans of Monty Python and the film, and, since 2004, an annual "Monty Python Day" has been held at the castle.