How did submarine warfare cause the U.S. to enter World War 1?

A German U-boat had sunk the British passenger ship the Lusitania at great loss of life. Unrestricted submarine warfare was suspended following public outcry in the US, but was reinstated in 1917. This eventually led to the American declaration of war on Germany.