The United Nations Convention on the Law of the Sea Article 19 defines innocent passage as:[1] Underwater vehicles like submarines are required by the treaty to surface and show their flags during innocent passage.
[2] Innocent passage applies to the entire territorial sea, up to at most 12 nautical miles (22 km; 14 mi) from coastal baseline.
[3][4] Initially, the right of innocent passage in the current sense began to take shape in the 1840s (as a customary rule) with the development of world trade and the emergence of steamships navigation, for which it was economically significant to use the shortest possible route often through the coastal waters of a foreign state.
[5] The law was codified in the 1958 Convention on the Territorial Sea and the Contiguous Zone and affirmed in the 1982 UNCLOS.
[6][7] The coastal state may temporarily suspend the innocent passage of foreign ships if "such suspension is essential for the protection of its security".