A senior US diplomat involved in Afghanistan has become the first American official to resign in protest over the eight-year war, saying it was fuelling the insurgency in the war-torn country.