Here comes the judge
The office of justice of the peace began in England sometime in the 12th century, when the king appointed mostly knights to keep the peace. In the 14th century a law was passed creating "conservators of the peace," who eventually came to be called justices of the peace. Also called magistrates, these were men -- unsurprisingly, given the times -- who were the first-line legal authorities in the counties they served. Although not exactly police, who pretty much didn't exist except in the office of sheriff, they were responsible for dealing with miscreants when complaints were lodged. They operated pretty much under their own authority, hearing the complaints and deciding what would happen if they decided the accused was guilty. The American office developed from this English legacy, as the English colonists followed what they knew when they arrived and set up shop. JPs were mostly elected, though governors of the colonies, and later the states, were sometimes empowered t...