A harbourmaster (or harbormaster, see spelling differences) is an official responsible for enforcing the regulations of a particular harbour or port, in order to ensure the safety of navigation, the security of the harbour and the correct operation of the port facilities. Responsibilities Harbourmasters are normally responsible for issuing local safety information sometimes known as notice to mariners. They may also oversee the maintenance and provision of navigational aids within the port, co-ordinate responses to emergencies, inspect vessels and oversee pilotage services. The harbourmaster may have legal power to detain, caution or even arrest persons committing an offence within the port or tidal range of the port's responsibilities. An example of this is the team of harbourmasters employed by the Port of London Authority who are empowered to undertake an enforcement role. Actions that a harbourmaster may investigate include criminal acts, immigration, customs and excise, maritime and river safety and environmental and pollution issues. The police, customs, coastguard or immigration authorities will take over the handling of any offenders or incident once informed by the harbourmaster. Worldwide there are approximately 3,000 merchant ports and the work of the Harbour Master can vary widely from country to country and from port to port even within the same country. Civilian and naval officers A harbourmaster may either be a civilian or a commissioned naval officer of any rank. Historically all harbourmasters were naval officers; even today they must possess prior seafaring knowledge and experience through serving with either a merchant navy or armed navy. The terms naval and civilian are used here to distinguish who is employed by a military force and who is employed by a public or private port. United Kingdom and Canada In the United Kingdom and Canada, a person that is appointed to superintend a dockyard port and ensures the port is secure for civilian and military shipping is known as a King's Harbour Master (or Queen's Harbour Master during the reign of a queen). In Canada, the position is also called a capitaine de port de Sa Majesté in French (). Although legislation does not require it, most KHMs are officers from the naval service. King's Harbour Masters are entitled to fly their own flag. The flag flown by British KHMs is a white-bordered Union Flag with a white central disc bearing the initials "KHM" beneath a crown. Canadian KHMs fly a similar flag, a white-bordered flag