World War I began in 1914 after tensions between European powers led to a system of alliances that pulled countries into war. The assassination of Archduke Franz Ferdinand led Austria-Hungary to declare war on Serbia, drawing in allies on both sides. Over four years, new military technologies like machine guns, tanks, aircraft, and poison gas led to stalemate and trench warfare with millions of casualties. The U.S. initially remained neutral but entered the war in 1917 after German U-boats attacked American ships. An armistice in 1918 ended the war. The ensuing Treaty of Versailles imposed harsh terms on Germany, sowing seeds for future conflict.