Mercury(II) fulminate, or Hg(CNO)2, is a primary explosive. It is highly sensitive to friction and shock and is mainly used as a trigger for other explosives in percussion caps and blasting caps. Mercury(II) cyanate, though its formula is identical, has a different atomic arrangement; the cyanate and fulminate anions are isomers.
First used as a priming composition in small copper caps after the 1830s, mercury fulminate quickly replaced flints as a means to ignite black powder charges in muzzle loading firearms. Later, during the late 19th century and most of the 20th century, mercury fulminate or potassium chlorate became widely used in primers for self-contained rifle and pistol ammunition. Mercury fulminate has the distinct advantage over potassium chlorate of being non-corrosive, but it is known to weaken with time. Today, mercury fulminate has been replaced in primers by more efficient chemical substances. Those are non-corrosive, less toxic and more stable over time: lead azide, lead styphnate and tetrazene derivatives. In addition, none of these compounds replacing Hg(II) fulminate requires mercury for manufacture, supplies of which can be unreliable in wartime.
Read more about Mercury(II) Fulminate: Preparation, In Popular Culture