U.S. and NATO commanders as well as Afghan President Hamid Karzai attended .