In Brazil, the Federal Constitution establishes eight law enforcement institutions - seven titulars and one auxiliar. The titular institutions are: the Federal Police, the Federal Highway Police, the Federal Railroad Police, the Federal Penal Police, the State Military Police and Fire Brigade, the State Civil Police and the State Penal Police. Of these, the first four are affiliated to federal authorities and the latter three are subordinated to state governments. These public safety institutions are part of the Executive branch of either federal or state government. Apart from these eight institutions, there are others which affiliate to municipal authorities: the Municipal Guards. According to Minister Alexandre de Moraes of the Supreme Federal Court, "...the Municipal Guards are inserted in public safety as the auxiliary and related body of public security force..." Federal law 13,022 (in effect since August 8, 2014) gave them de facto and de jure police attributions. According to the Supreme Federal Tribunal, Law enforcement forces with an obligation to maintain public safety by Brazilian law are the ones listed in article 144 of the Federal Constitution's Caput, that is, the first seven aforementioned forces. As a new force cited in the Federal Constitution Article 144, Eighth Paragraph; the guards act in support and complement - without a relationship of subordination with them. In case of criminal occurrence (in flagrante delicto), Guards forward the occurrence to the Civil and/or Federal police. There are two primary police functions: maintaining order and law enforcement. When criminal offences affect federal entities, federal police forces carry out those functions. In the remaining cases, the state police forces undertake police activities. History The first groups assigned with security duties in Brazilian territory date back to the early sixteenth century. Small, incipient units were designated in the Brazilian coastline, with the main function of fending off hostile foreign invaders. In 1566, the first police investigator of Rio de Janeiro was recruited. By the seventeenth century, most "capitanias" already had local units with law enforcement functions. On July 9, 1775 a Cavalry Regiment was created in Minas Gerais for maintaining order. At the time, intense gold mining had attracted attention and greed of explorers, generating tensions in the area. In 1808, the Portuguese royal family relocated to Brazil, due to the French invasion of Portugal. King João VI sought to reshape the administrative structure of the colony. Among several reforms, he established the "Intendência Geral