The Coast Guard is an intervillage organization which was originally a branch of individual coastal police departments (starting around 362), before breaking off from the police and uniting with each other in 371. Ranks in the Coast Guard range from Admiral, to captain, commander, lieutenant, and sailor. Most members of the Coast Guard serve on ships, though there are those who work entirely on land, such as administrators, liaisons with the police, quartermasters (who are in charge of provisions), or dockworkers (who are responsible for maintenance and repairs to ships). Also, sailors and lieutenants have rotating shifts spent either on ships or at their bases, at different times.
Since the earliest days of The Land, there were rarely crimes, but whenever one stood accused, he or she could be defended by an impartial third party (or simply defend themself, if they so chose). Over the centuries, hearings became somewhat more formalized (at some point it became more common for the accused to be prosecuted by an impartial party as well as defended by such), though there was not a fully standardized set of laws or court procedures until 899, upon the establishment of the court system. The roles of both defense and prosecuting lawyers (or attorneys) has since then become more clearly defined.
Like lawyers, this is a position which has become more clearly defined since 899, before which time the position was only very rarely used at all. In the past, lawyers would try their cases for or against the accused in front of an assembly of citizens who were tested for impartiality, and who would vote on whether they believed the accused to be guilty or innocent, and how to punish him or her, if guilty. There was never any standard for how many people could be in attendance at a trial, nor for their knowledge of the law. Since 899, this system has been replaced by the appointment of judges who are known to be both impartial and well versed in law, usually after having served for some years as a lawyer (they are appointed by village councils). Judges are the ones who now ultimately determine guilt or innocence, and sentencing; though their decisions can be appealed to the High Court.
Magistrates are essentially judges, but they are elected by citizens of each village to serve on the High Court (with one of the elected being then appointed by the monarch to serve as the Chief Magistrate).
The word "police" can refer to the collective organization or to individuals within that organization. They work in police departments (first established in 238), with ranks including Chief of Police, deputy chief, detective, and patrolman. In 899, InterVil was established, as a means of expediting and simplifying joint operations between the police departments of different villages. Each village's police chief sends one of his detectives to serve as a liaison with InterVil, while a Commissioner is chosen by a vote among all the police chiefs.