The troop withdrawal ends American operations against the terrorist group conducted jointly with a Kurdish-led militia.