The American-Algerian War was a state of conflict which existed between the Regency of Algiers and the United States that lasted from 1785 to 1795. Occurring after the U.S. became independent from the British Empire as a result of the American Revolutionary War, Algiers declared war on the United States after realizing that American merchant shipping was no longer under the protection of the Royal Navy.