The Second Barbary War (1815) or the U.S.–Algerian war was fought between the United States and the North African Barbary Coast states of Tripoli, Tunis, and Ottoman Algeria. The war ended when the United States Senate ratified Commodore Stephen Decatur’s Algerian treaty on December 5, 1815. However, Dey Omar Agha of Algeria repudiated the US treaty, refused to accept the terms of peace that had been ratified by the Congress of Vienna, and threatened the lives of all Christian inhabitants of Algiers. William Shaler was the US commissioner in Algiers who had negotiated alongside Decatur, but he fled aboard British vessels during the Bombardment of Algiers (1816). He negotiated a new treaty in 1816 which was not ratified by the Senate until February 11, 1822, because of an oversight.