The September 11 attacks in 2001 led to the United States, United Kingdom, Spain, Canada and other nations invading Afghanistan , as well as implementing various anti-terrorist measures at home and abroad in what was known as the War on Terror .