Coastal artillery is the branch of the armed forces concerned with operating anti-ship artillery or fixed gun batteries in coastal fortifications. From the Middle Ages until World War II, coastal artillery and naval artillery in the form of cannons were highly important to military affairs and generally represented the areas of highest technology and capital cost among materiel. The advent of 20th-century technologies, especially military aviation, naval aviation, jet aircraft, and guided missiles, reduced the primacy of cannons, battleships, and coastal artillery. In countries where coastal artillery has not been disbanded, these forces have acquired amphibious capabilities. In littoral warfare, mobile coastal artillery armed with surface-to-surface missiles can still be used to deny the use of sea lanes. It was long held as a rule of thumb that one shore-based gun equaled three naval guns of the same caliber, due to the steadiness of the coastal gun which allowed for significantly higher accuracy than their sea-mounted counterparts. Land-based guns also benefited in most cases from the additional protection of walls or earth mounds. The range of gunpowder-based coastal artillery also has a derivative role in international law and diplomacy, wherein a country's three mile limit of "coastal waters" is recognized as under the nation or state's laws. History One of the first recorded uses of coastal artillery was in 1381—during the war between Ferdinand I of Portugal and Henry II of Castile—when the troops of the King of Portugal used cannons to defend Lisbon against an attack from the Castilian naval fleet. The use of coastal artillery expanded during the Age of Discoveries, in the 16th century; when a colonial power took over an overseas territory, one of their first tasks was to build a coastal fortress, both to deter rival naval powers and to subjugate the natives. The Martello tower is an excellent example of a widely used coastal fort which mounted defensive artillery, in this case muzzle-loading cannon. During the 19th century China also built hundreds of coastal fortresses in an attempt to counter Western naval threats. Coastal artillery fortifications generally followed the development of land fortifications; sometimes separate land defence forts were built to protect coastal forts. Through the middle 19th century, coastal forts could be bastion forts, star forts, polygonal forts, or sea forts, the first three types often with detached gun batteries called "water batteries". Coastal defence weapons throughout history were heavy naval guns or