Afghan President Hamid Karzai says terrorists who are killing foreign soldiers in his country want the international community to fail in its efforts to rebuild war-torn Afghanistan .