From its foundation in the 13th century Sligo was administered under local Fénechus (Brehon law) until the establishment of English Common law in the early 17th century after the battle of Kinsale. Courts were held regularly throughout the tuath at various buildings and on hilltops reserved for the purpose. Law enforcement was a function of the nobility and freemen of the area as no police force existed. No records survive from these early courts, but a case is recorded of a Dublin merchant being reimbursed by the local courts after he was fraudulently sold an out of date poem in the 1540s. Sligo then came under English martial law and eventually the common law as administered from Dublin and from which descends the present system.