Gun salutes are the firing of cannons or arms as a (military or naval) honour.
The custom originates in naval tradition, where a warship would fire its cannons harmlessly out to sea to show that it was disarmed, signifying the lack of hostile intent.
As naval customs evolved 21 volleys came to be fired for heads of state, with the number decreasing with the rank of the recipient of the honour. Multiples of 21gun salutes may be fired for particularly important celebrations.The tradition of saluting can be traced to the Middle Ages practice of placing oneself in an unarmed position and, therefore, in the power of those being honoured. This may be noted in the dropping of the point of the sword, presenting arms, firing cannon and small arms, lowering sails, manning the yards, removing the headdress or laying on oars.
The gun salute might have originated in the 17th century with the maritime practice of demanding that a defeated enemy expend its ammunition and render itself helpless until reloaded — a time-consuming operation in that era. Also, the gun salute was established as a naval tradition by the late sixteenth century. A man o' war which visited a foreign port would discharge all its guns to show that its guns were empty. Since the ship would not have enough time to reload before it was within range of the shore batteries, it was clearly demonstrating its friendly intentions by going in with empty guns.
Salute by gunfire is an ancient ceremony. The British for years compelled weaker nations to render the first salute; but in time, international practice compelled "gun for gun" on the principle of equality of nations. In the earliest days, seven guns was the recognized British national salute because seven was the standard number of weapons on a vessel. In that day, gunpowder made from sodium nitrate was easier to keep on dry land than at sea. Thus those early regulations stated that although a ship would fire only seven guns, the forts ashore would fire three shots to each one shot afloat, hence the number 21.
The system of odd numbered rounds is said to have been originated by Samuel Pepys, Secretary to the Navy in the Restoration, as a way of economising on the use of powder, the rule until that time having been that all guns had to be fired. Odd numbers were chosen, as even numbers indicated a death.
With the increase in quality of naval gunpowder, by the use of potassium nitrate, honours rendered at sea were increased to the shore salute. 21 guns became the highest national honour, although for a period of time, monarchies received more guns than republics. Eventually republics gained equality in Britain's eyes.
India during the period of British rule developed a formal hierarchical system of gun salutes. Apart from the 101 gun Imperial salute reserved for the British monarch, the more important of the hundreds of vassal rulers of princely states involved in indirect rule were classified by the number of guns used when paying honours to them, signifying their prestige in the eyes of the British. The highest of these so-called "salute states" (also in some other parts of the British Empire) enjoyed 21 guns (Hyderabad, Patiala, Berar, Mysore, Jammu and Kashmir, Baroda, and Gwalior). For years, a few rulers not formally under the control of the British were granted 21 guns (Nepal, Oman, Mosquito Coast and Zanzibar) or even 31 guns (Afghanistan and Siam).
There was much confusion because of the varying customs of maritime states, but finally the British government proposed to the United States a regulation that provided for "salutes to be returned gun for gun." The British at that time officially considered the international salute to sovereign states to be 21 guns, and the United States adopted the 21 guns and "gun for gun" return on August 18, 1875.