The War of 1812 was fought between the United States and Great Britain from 1812 to 1815 over British violations of American maritime rights and trade. While the war ended in a stalemate, it established the United States as an independent nation and inspired Francis Scott Key to write "The Star-Spangled Banner".