The Espionage Act of 1917 was a United States federal law that aimed to prohibit interference with military operations, support for U.S. enemies during wartime, and the promotion of insubordination in the military. This act was enacted shortly after the U.S. entered World War I, reflecting the government's concern over national security and the potential for dissent among the public. It was used to suppress anti-war sentiments and enforce loyalty to the U.S. during a time when unity was deemed crucial for the war effort.