In 1915, public outrage in the US against the Germans swept the nation following the sinking of the British ocean liner, Lusitania. When a German U-boat (submarine) sank the Lusitania in May, 1915, over 1,000 persons were killed, including more than 100 Americans. The passenger liner was targeted by the Germans because they suspected weapons were being shipped to Britain in the cargo hold of the ship.
Germany managed to stave off American entry into the war at the time by pledging to stop submarine attacks.
Two years later, however, Germany resumed unrestricted submarine warfare. This fact, coupled with an intercepted telegram (the "Zimmerman Telegram"), which showed Germany was trying to secure Mexico as an ally against the United States, prompted the US to declare war on Germany on April 6, 1917.