USS Cairo was sunk in an attempt to destroy Confederate batteries in Vicksburg, the key to the South's control of the Mississippi River.
From the website for the Vicksburg National Military Park (where the shell of the skeletal Cairo is now display): On the cold morning of December 12, 1862, [Cairo Skipper Thomas O.] Selfridge led a small flotilla up the Yazoo River, north of Vicksburg, to destroy Confederate batteries and clear the channel of torpedoes (underwater mines). As the Cairo reached a point seven miles north of Vicksburg the flotilla came under fire and Selfridge ordered the guns to ready. As the gunboat turned towards shore disaster struck. Cairo was rocked by two explosions in quick succession which tore gaping holes in the ship's hull. Within twelve minutes the ironclad sank into six (6) fathoms (36 feet) of water without any loss of life. Cairo became the first ship in history to be sunk by an electrically detonated torpedo.
The loss of Vicksburg to the North effectively split the Confedaracy in two and ultimately led to the South's defeat. After a long siege, Vicksburg surrendered on July 4th, 1863, consequently shaming the city and thus making an Independence Day celebration in V'burg socially taboo for the next 100 years.