Soldier killed in Afghan attack was American: official