William Anderson Memorial Prize Essay

This is an essay entry for https://oldedinburghclub.org.uk/projects/the-william-anderson-memorial-prize-a-written-local-history-competition-is-announced/

James McLevy: A Victorian Detective in Edinburgh’s Hidden City

Edinburgh’s long history is often told through its great buildings, intellectual achievements, and civic institutions. Castles, universities, and planned streets dominate the city’s historical imagination. Yet for much of the nineteenth century, Edinburgh was experienced very differently by the majority of its inhabitants. Overcrowded housing, insecure employment, disease, and limited access to education shaped everyday life, particularly in the Old Town. To understand this lived city, it is necessary to examine figures who worked at street level and engaged directly with its most vulnerable communities. One such figure was James McLevy, Edinburgh’s first official detective.

McLevy’s significance lies not only in his pioneering role within policing, but in his sustained engagement with the social realities of nineteenth-century Edinburgh. Through his detective work, his involvement with reform movements, and his later writings, McLevy documented crime as a product of urban conditions rather than abstract moral failure. His career offers a lens through which to explore how crime, policing, housing, and reform operated within the streets, wynds, and closes of Victorian Edinburgh.


An Immigrant in a Divided City

James McLevy was born in 1796 in Ballymacnab, County Armagh, Ireland. He arrived in Edinburgh as a young man during a period of economic hardship following the Napoleonic Wars. Like many Irish migrants, he encountered suspicion and insecurity. Initially trained as a fine-linen weaver, he found work instead as a labourer in the building trades. Shortly after arriving in the city, his wife, Rosa O’Neill, died, and he never remarried.

In 1815, Edinburgh was a sharply divided city. The New Town embodied Enlightenment ideals of order, improvement, and rational planning. In contrast, the Old Town remained densely populated and deeply impoverished. Tall tenements housed multiple families in single rooms. Sanitation was inadequate, clean water scarce, and disease common. Areas around the High Street, Cowgate, and Canongate were among the most overcrowded in Britain. These were the environments that would shape McLevy’s working life.

Housing conditions lay at the heart of the city’s social problems. The vertical density of the Old Town forced families into cramped, poorly ventilated spaces with little privacy. Lodging houses and subdivided flats accommodated transient populations, including seasonal labourers and recent migrants, many of them Irish. Such conditions fostered stress, instability, and conflict. McLevy’s later writings repeatedly returned to these environments, describing how overcrowding, alcoholism, and desperation combined to generate opportunistic crime. His observations challenged contemporary assumptions that crime stemmed from innate moral failings rather than social circumstance.


Irish Migration, Famine, and the Cowgate

Irish migration formed a significant part of Edinburgh’s nineteenth-century population growth, particularly in the Old Town. Long before the Great Famine, Irish labourers were drawn to the city by seasonal work, construction, and domestic service. From the late 1840s, however, migration increased sharply as families fled the devastation of the Great Famine. Many arrived with few resources and little security, settling where rents were lowest and accommodation most readily available. In Edinburgh, this often meant the crowded tenements and lodging houses of the Old Town, especially in and around the Cowgate.

The Cowgate became closely associated in the public imagination with Irish poverty, disease, and disorder, though this reputation obscured a more complex reality. Families lived in extreme overcrowding, frequently sharing single rooms and taking in lodgers to survive. Poor sanitation, irregular employment, and widespread prejudice compounded their vulnerability. Irish residents were often blamed for conditions they neither created nor controlled, reinforcing sectarian tensions and moral anxieties. For police officers such as James McLevy, the Cowgate was not simply an “Irish quarter” but a densely populated district shaped by displacement, labour insecurity, and survival. His writings suggest an awareness that migration, poverty, and environment—not ethnicity—lay at the root of many of the social problems encountered in these streets.


The Emergence of Modern Policing

In 1830, McLevy joined the Edinburgh police force established following the Edinburgh Police Act of 1805, which had abolished the old town guard. At that time, policing remained rudimentary. Officers were poorly paid, unevenly trained, and often distrusted by the communities they served. Crime control relied heavily on night watchmen and reactive punishment.

McLevy stood out for his methodical approach. In 1833, he was appointed Edinburgh’s first full-time detective, later designated “Criminal Officer Number One.” This marked an important moment in the city’s civic history. Crime was increasingly understood as a phenomenon requiring investigation, intelligence, and record-keeping rather than simple apprehension.

McLevy’s methods were rooted in intimate knowledge of Edinburgh’s streets. He worked on foot, moving constantly through closes, wynds, lodging houses, markets, and taverns. He knew which pawnshops handled stolen goods and which lodging houses sheltered habitual offenders. A theft in the Grassmarket might lead him within hours to a resetter in the Canongate. In an era before fingerprints, photography, or centralised records, detection relied on memory, observation, and personal networks. McLevy became renowned for recognising individuals, recalling past offences, and identifying patterns of behaviour.

Over a career of nearly thirty years, he investigated thousands of cases. His success owed little to technology and much to local knowledge and an understanding of the city as a social ecosystem shaped by poverty, migration, and opportunity.


Legislation, Drink, and the Streets

Mid-century legislation reshaped everyday policing in Edinburgh. Contemporary observers increasingly linked crime to environment, drink, and living conditions. In 1850, Dr George Bell published a detailed study of Blackfriars’ Wynd, a once-respectable street that had declined into one of the city’s most notorious slums. Using the wynd as a representative example, Bell argued that poverty was not simply a lack of income but a complex interaction of overcrowding, poor sanitation, and habitual intemperance. Moral reform, he insisted, was impossible without first addressing these physical conditions. 

The Licensing (Scotland) Act of 1853, commonly known as the Forbes-Mackenzie Act, restricted public-house opening hours and prohibited Sunday trading. Although framed as a licensing measure, the Act embedded moral regulation into daily police work. Drunkenness and Sabbath drinking became matters of routine enforcement, particularly in working-class districts of the Old Town.

The Act illustrates how social reform, moral discipline, and policing became increasingly intertwined in Victorian Edinburgh.

The Police (Scotland) Act of 1857 further professionalised policing by standardising pay, conditions, and organisation across Scottish burghs. This enhanced institutional legitimacy but also expanded expectations placed on officers operating in challenging urban environments.


Mobility and Change

Transportation developments also transformed crime and policing. Improved roads and coaching routes altered movement within and beyond the city. Most significantly, the arrival of the railways from the 1840s created new patterns of mobility. Waverley Station became a hub of commerce, anonymity, and rapid movement. Offenders could now leave the city within minutes, forcing detectives to understand routes, timetables, and lodging houses clustered around stations.

The electric telegraph, introduced in the mid-nineteenth century, further altered policing by enabling faster communication between authorities. McLevy’s career spanned this transitional moment, bridging older, experience-based policing and emerging bureaucratic systems.


Crime as a Social Phenomenon

McLevy consistently treated crime as a social phenomenon rooted in environment and circumstance. In 1856, his expertise was recognised nationally when he gave evidence before a parliamentary select committee on criminal transportation. His views were later cited by social reformer Mary Carpenter in her writings on juvenile delinquency and rehabilitation.

He also supported local reform initiatives, including the Carrubbers Close Mission, founded in 1858 by Dr Thomas Guthrie. Located just off the High Street, the mission worked among some of the city’s poorest residents, offering education, moral instruction, and practical support. McLevy recognised that policing and reform addressed the same problems from different directions. Order could not be maintained by enforcement alone.

His sympathy is especially evident in his treatment of women and young offenders. He described how economic desperation pushed women into petty crime and how children raised in overcrowded, neglectful environments were drawn into offending at an early age. These observations aligned closely with the principles of ragged schools and early intervention promoted by reformers.


Medicine, Evidence, and Authority

The later years of McLevy’s career coincided with advances in forensic medicine. In 1855, Dr Henry Littlejohn was appointed Edinburgh’s first Police Surgeon, later becoming the city’s first Medical Officer of Health. Littlejohn introduced systematic post-mortem examinations, toxicology, and careful medical documentation, strengthening the evidential basis of criminal prosecutions.

Together, McLevy’s investigative testimony and Littlejohn’s medical evidence helped move Edinburgh policing away from reliance on confession and reputation towards more structured forms of proof. Their work marked a shift towards modern, evidence-based criminal justice.

McLevy lived to see Littlejohn’s Report on the Sanitary Condition of the City of Edinburgh published in 1865, followed by the City Improvement Act of 1867, which widened streets and cleared some of the worst slums of the Old Town.


Writing the Hidden City

After retiring in the early 1860s, McLevy turned to writing. His books, including Curiosities of Crime in Edinburgh and The Sliding Scale of Life, were based on real cases and achieved wide popularity. They preserve details of everyday life rarely recorded elsewhere: crowded rooms, informal economies, transport-related crime, and interactions between migrants and authorities. For historians, these accounts remain invaluable sources for understanding how ordinary people experienced the city.

McLevy lived quietly in later life. His sister Mary joined him in Edinburgh, and his niece cared for him in his final years. He died in 1873 and was buried in Canongate Kirkyard, his wooden grave marker long since vanished.


Conclusion

James McLevy’s career marks a formative moment in the development of modern policing in Edinburgh. His methods—grounded in observation, local knowledge, and an understanding of social context—anticipated later professional practices shaped by bureaucracy and forensic science. More importantly, his life reveals an Edinburgh often absent from grand historical narratives: a city of overcrowded rooms, fragile livelihoods, negotiated authority, and persistent reform efforts.

Through McLevy’s eyes, we glimpse how institutions functioned in practice and how policing intersected with housing, poverty, drink, and moral reform. His work complements Edinburgh’s architectural and intellectual histories by showing how the city actually operated at ground level. It is this lived, contested city—later brought to life for modern audiences in the BBC radio series “McLevy” —that emerges most clearly from his career: a hidden Edinburgh shaped as much by wynds and closes as by courts and monuments.