Maggie Dickson, a Musselburgh fish-wife, broke the 'Concealment of Pregnancy' law after an affair with an innkeeper. The baby died after the birth and she left the corpse on a riverbank.
But the body was found and identified, and Maggie was hanged in the Grassmarket in 1728.
Afterwards, people heard noises from the burial cart - upon opening the coffin they discovered Maggie wasn't as dead as she ought to have been.
If Maggie had been hanged in England, the poor woman would have been strung up again, as English law dictated that a person must be hanged until dead. But under Scots law Maggie was legally dead - and was allowed to go free.
She went on to have more children and live a long life running an ale house.
There's now a pub named after her on West Port, just off the Grassmarket.