20 Years
It was a 20 years long struggle for the United States government and its Army. The struggle to take revenge from the Taliban for its audacity to enter the United States and attack the World Trade Center and the Pentagon. The revenge was well taken. 20 years in their territory, destroying their deeds and finishing off terrorism, it was well executed by the U.S. Armed force. It is commendable to living away from your family in a different country to end terrorism. In those 20 years, the American troops, with the support of the Afghanistan government, destroyed a lot of Taliban's hideouts, killed huge amount of terrorists and militants, gained control over many places that were under the control of the Taliban earlier, and provided the people of Afghanistan a better living. All this started after the 9/11 attack in 2001, and stretched till the end of 2021, making it the longest operation against terrorism in the American history which lasted for 20 years.