The Battle of Lochmaben Fair was an engagement in Lochmaben, Scotland, on 22 July 1484 between Scottish loyalists to James III of Scotland and the rebels Alexander Stewart, Duke of Albany and James Douglas, 9th Earl of Douglas, leading cavalry from England. Both exiles from Scotland, Albany and Douglas invaded with permission but not support of Richard III of England, hoping to encourage rebellion against James. Instead, they were met with armed resistance. The loyalists took the day. Douglas was captured and Albany forced to retreat.
The unpopular Scottish king James III had been imprisoned in Edinburgh Castle following his arrest by his own nobles at Lauder Bridge in July 1482. Alexander Stewart, Duke of Albany, his younger brother, soon took control of the government, but his power was short-lived. Through bribery and the support of such powerful individuals as George Gordon, 2nd Earl of Huntly, James III regained his throne, and Albany was forced to flee, first in January 1483 to Dunbar and then on 9 April to England. Douglas, a rebel against Albany's father James II of Scotland, had resided in England since his lands had been forfeit to the crown in 1455. There, in the employ of Edward IV of England, he had become a Knight of the Garter.
The recently crowned English king Richard III initially planned to invade Scotland, but with other matters of state taking precedence instead only gave his permission for Albany and Douglas to launch an invasion on their own. The pair did so, bringing 500 horsemen to Lochmaben on 22 July 1484 during the annual fair. Though Albany and Douglas had hoped to incite the Scots to rebel against James, instead the townspeople took to arms against them, soon receiving assistance from the gentry in the area. The English cavalry routed, Albany retreated to France, while Douglas was captured.