Captain retires from sheriff's office