The royal burgh of Sanquhar is located on the River Nith near its meeting with Crawick Water and Euchan Water, 26 miles (42 km) northwest of Dumfries. Created a royal burgh in 1598, it developed around the wool-trade with the Sanquhar Wool Fair, held annually in July, setting prices for the entire south of Scotland. Cottage weaving and hand-knitting produced many distinctive patterns which were unique to the town. The textile industry (worsteds) continued to flourish in the 18th century, with stockings and gloves exported to Virginia, although this trade fell away with the American War of Independence. The town grew in the early 19th Century with the development of coal-mining and brick-making.
The town is famous as the site where, in 1680, school-teacher Richard Cameron and an armed band of extreme Presbyterians established their rebellion against Charles II with the Declaration of Sanquhar. Though killed soon after, the remnant of his men formed the regiment of the Cameronians. A second Declaration was put forth in 1685 by James Renwick.
There are remains of Roman fortifications here, and notable buildings include the ruined Sanquhar Castle (15th century), the Tolbooth (1735, designed by William Adam for the 3rd Duke of Queensberry and built from stone taken from Sanquhar Castle), Council Offices (1814), the Town Hall (1882) and, on the High Street, the oldest Post Office in the world, which began operating in 1712, the building itself being constructed in the mid-17th century also using material reclaimed from the castle. The Mercat Cross (1680) is built into the garden wall of St Ninian's Manse. The Buccleuch Terracotta Brick Works operated until the 1960s. There was also once a creamery, which was a significant employer in the town. Opposite the Town Hall the brick-built former offices of the Sanquhar and Kirkconnel Coal Company (1917) have been restored as a private residence - Colliery House. The Gateside Colliery, located 1¼ miles (2 km) northwest of the town, closed in the 1960s, although coal-mining continued at nearby Kirkconnel until 1980 and open-cast mining persists in the area. An extensive factory making fireworks and other explosives was established next to the former Gateside mine to bring new jobs, although it employed mostly women. This factory continues to operate, but on a much reduced scale making a novel type of explosive detonator for the open-cast mining industry. Other contemporary industries include the manufacture of school furniture by Eme (established here in 1965) and carpet tiles, using a patented backing process developed locally.
Sanquhar benefits from a library and Sanquhar Academy is a modern school located to the northwest of the town, while the former school on Queensberry Square is in ruins. The station buildings date from 1850; the station closed in 1965, but re-opened in 1994 as an unmanned halt on the line from Kilmarnock to Dumfries.