The tradition of rendering a salute by cannon originated in the 14th century as firearms and cannons came into use. Since these early devices contained only one projectile, discharging them once rendered them ineffective. Originally warships fired seven-gun salutes--the number seven probably selected because of its astrological and Biblical significance. Seven planets had been identified and the phases of the moon changed every seven days. The Bible states that God rested on the seventh day after Creation, that every seventh year was sabbatical and that the seven times seventh year ushered in the Jubilee year.
Land batteries, having a greater supply of gunpowder, were able to fire three guns for every shot fired afloat, hence the salute by shore batteries was 21 guns. The multiple of three probably was chosen because of the mystical significance of the number three in many ancient civilizations. Early gunpowder, composed mainly of sodium nitrate, spoiled easily at sea, but could be kept cooler and drier in land magazines. When potassium nitrate improved the quality of gunpowder, ships at sea adopted the salute of 21 guns.
For many years, the number of guns fired for various purposes differed from country to country. By 1730, the Royal Navy was prescribing 21 guns for certain anniversary dates, although this was not mandatory as a salute to the Royal family until later in the eighteenth century.
Several famous incidents involving gun salutes took place during the American Revolution. On 16 November 1776, the Continental Navy brigantine Andrew Doria, Captain Isaiah Robinson, fired a salute of 13 guns on entering the harbor of St. Eustatius in the West Indies (some accounts give 11 as the number). A few minutes later, the salute was returned by 9 (or 11) guns by order of the Dutch governor of the island. At the time, a 13 gun salute would have represented the 13 newly-formed United States; the customary salute rendered to a republic at that time was 9 guns. This has been called the "first salute" to the American flag. About three weeks before, however, an American schooner had had her colors saluted at the Danish island of St. Croix. The flag flown by the Andrew Doria and the unnamed American schooner in 1776 was not the Stars and Stripes, which had not yet been adopted. Rather, it was the Grand Union flag, consisting of thirteen alternating red and white stripes with the British Jack in the union.
The first official salute by a foreign nation to the Stars and Stripes took place on 14 February 1778, when the Continental Navy ship Ranger, Captain John Paul Jones, fired 13 guns and received 9 in return from the French fleet anchored in Quiberon Bay, France.
The 21-gun salute became the highest honor a nation rendered. Varying customs among the maritime powers led to confusion in saluting and return of salutes. Great Britain, the world's preeminent seapower in the 18th and 19th centuries, compelled weaker nations to salute first, and for a time monarchies received more guns than did republics. Eventually, by agreement, the international salute was established at 21 guns, although the United States did not agree on this procedure until August 1875.
The gun salute system of the United States has changed considerably over the years. In 1810, the "national salute" was defined by the War Department as equal to the number of states in the Union--at that time 17. This salute was fired by all U.S. military installations at 1:00 p.m. (later at noon) on Independence Day. The President also received a salute equal to the number of states whenever he visited a military installation.