Located 6 miles (10 km) east of Edinburgh and straddling the River Esk. The area has a long history beginning with a Roman fort at Inveresk and later the town itself, first named Eskmouth and later Musselburgh for the mussel bank at the mouth of the Esk. Its nickname is 'the honest toun'. The town, with its shrines to Our Lady of Loretto and St Mary Magdalen, was given to the abbey of Dunfermline by David I.
It was created a burgh of barony (1315-28) and later became a burgh of regality (1562); in 1632 it attempted to become a royal burgh but this was blocked by Edinburgh burgesses who wanted to control the area's trade. Rivalry between the two towns is evident in the old rhyme, "Musselburgh was a burgh when Edinburgh was nane / And Musselburgh will be a burgh when Edinburgh has gane"
Although Musselburgh was always a burgh of Midlothian, it was detached in the local government reorganisation of 1975 to increase the population of East Lothian. This situation persisted through the further reorganisation of 1996. Originally a fishing town, Musselburgh later made textiles, paper, fishing nets and wire; today it is a dormitory and market town.
There are several sights and buildings, including The Links at the east end, where horse races have taken place since 1816 and where King James IV supposedly played golf in 1504. Loretto School (18th/19th-centuries) was named for the now-ruined 16th-century chapel and hermitage of Our Lady of Loretto which served as a hospital following the Battle of Pinkie in 1547. After its destruction in the Reformation its rubble was used to build the Tolbooth. Pinkie House, where Bonnie Prince Charlie stayed, now forms part of Loretto School. The Institute of Seaweed Research, located at nearby Inveresk, gave way to Inveresk Research International, which is now based in Tranent.
There is one 18-hole golf course at Monktonhall, and a monument to Dr D.M. Moir, the 19th-century poet and novelist.