Afghanistan unlike Iraq was pretty clear though. Bin laden was hiding there and the Taliban were refusing to give him up also Afghanistan was in a state of permanent civil war and the Taliban government was not recognized internationally . So US wasn’t exactly invading a sovereign country (unlike what happened with Kuwait, Iraq II and the Ukraine).