Cupar was created a royal burgh in 1328, though its name is Pictish, suggesting that there had been an important settlement there since the 7th or 8th century if not earlier. Until the 16th century it was among the richest royal burghs in Scotland, but declined in the 17th century, its trade handicapped by its distance from the sea. It flourished once again as a centre of the linen industry in the 18th century. As the county town of Fife, and a town which serviced travellers on their way from Edinburgh to Dundee and Aberdeen, Cupar became a 'leisure town', attracting well-off retired people and country gentry to its balls, horse races, theatre and library, as well as the services offered by banks, lawyers and doctors (and brothels).
But by the mid 19th century the railway carried travellers through without stopping, industrial development shifted to west Fife where coal was plentiful, and St Andrews took over as the cultural centre of east Fife. Because the town did not develop major industries, it retains its medieval town plan and many fine buildings from its Georgian heyday.