The expression flag State indicates the State which attributes its nationality to a ship.
The term nationality or flag designates a criterion of connection of the ship with the legal system of a State. The nationality of the ship entails, on the one hand, the subjection of the same and of the crew on board to the sovereignty of this.
In order for a State to legitimately grant its flag, there must be a "substantial link" (the "genuine link" according to the terminology of Geneva, II, 5, 1; UNCLOS 91, 1) between the ship and the national law.
From a practical point of view, a State attributes its nationality to a ship by registering the same in special registers (for example the International Register for Italy or the Lloyd's Register for the United Kingdom), the registration of the ship determines the quantity of merchant tonnage available to the State, whose importance from the point of view of maritime trade is therefore determined by the total merchant tonnage of the ships flying its flag.
Each ship may sail under the flag of a single State and is subject, on the high seas, to its exclusive jurisdiction.
Ships without nationality, i.e. those not legitimately registered in any country, not being able to invoke the protection of any state, are subject to the jurisdiction of all nations. Vessels sailing under the flag of one or more states, using them as "flags of convenience", are assimilated to ships without nationality, since they cannot claim any nationality.
Indications (which evidently cannot be investigated at sea) of the lack of nationality are considered:
Warships of any country may therefore, as part of the exercise of the powers attached to the right of access, subject such ships to a flag survey and, if the lack of nationality is confirmed, capture them and take them by force to a port national for the appropriate measures.
The vessel flying the flag of a state is considered to all effects and purposes the territory of the flag state, this entails the subjection of the vessel and the crew on board to the sovereignty of the flag state.
The United Nations Convention on the Law of the Sea of 10 December 1982 establishes that any ship can register and sail under the flag of any State. On the high seas it is subject to the exclusive jurisdiction of military vessels of the same flag, unless there are proven suspicions of trafficking in arms, drugs, slaves, etc.
Naval vessels of any country may flag stateless vessels, capture them, and forcibly take them to a national port for remediation.
On the other hand, any ship can navigate within territorial waters and moor in the ports of a third country, provided that such navigation is not considered offensive.
When entering the territorial waters of a state other than the flag state, it is mandatory to display the so-called "courtesy flag" as a declaration of recognition of subjecting oneself to the navigation laws of the host state.