A consul is an official representative of the government of one state in the territory of another, normally acting to assist and protect the citizens of the consul's own country, and to facilitate trade and friendship between the people of the two countries. A consul is distinguished from an ambassador, the latter being a representative from one head of state to another. There can be only one ambassador from one country to another, representing the first country's head of state to that of the second, and his or her duties revolve around diplomatic relations between the two countries; however, there may be several consuls, one in each of several main cities, providing assistance with bureaucratic issues to both the citizens of the consul's own country travelling or living abroad and to the citizens of the country in which the consul resides who wish to travel to or trade with the consul's country.
In Classical Greece, some of the functions of the modern consul were fulfilled by a proxenos. Unlike the modern position, this was a citizen of the host polity (in Greece, a city state). The proxenos was usually a wealthy merchant who had socio-economic ties with another city and who helped its citizens when they were in trouble in his own city. The position of proxenos was often hereditary in a particular family. Modern honorary consuls fulfil a function that is to a degree similar to that of the ancient Greek institution.
Consuls were the highest magistrates of the Roman Republic and Roman Empire. The term was revived by the Republic of Genoa, which, unlike Rome, bestowed it on various state officials, not necessarily restricted to the highest. Among these were Genoese officials stationed in various Mediterranean ports, whose role included duties similar to those of the modern consul, i.e. helping Genoese merchants and sailors in difficulties with the local authorities.
The Consolat de mar was an institution established under the reign of Peter IV of Aragon in the fourteenth century, and spread to 47 locations throughout the Mediterranean. It was primarily a judicial body, administering maritime and commercial law as Lex Mercatoria. Although the Consolat de mar was established by the Corts General (parliament) of the Crown of Aragon, the consuls were independent from the King. This distinction between consular and diplomatic functions remains (at least formally) to this day. Modern consuls retain limited judicial powers to settle disputes on ships from their country (notably regarding the payment of wages to sailors).