Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates that when the Haruriyyah (the Khawarij) rebelled and separated, I said to them: "On the day of al-Hudaybiyah the Messenger of Allah (peace and blessings be upon him) made a treaty with the polytheists, and said to Sayyiduna Ali (may Allah be pleased with him): 'O Ali, write: This is what Muhammad, the Messenger of Allah, has agreed upon.' The polytheists said: 'If we were certain that you are the Messenger of Allah, we would not have fought you.' Then the Messenger of Allah (peace and blessings be upon him) said: 'O Ali, erase it.' Then he supplicated: 'O Allah, You know well that I am Your Messenger.' Then he said: 'O Ali, erase it and write: This is what Muhammad bin Abdullah has agreed upon.'
By Allah, the Messenger of Allah (peace and blessings be upon him) is far superior to Sayyiduna Ali (may Allah be pleased with him), yet he (peace and blessings be upon him) had himself erased (from the words 'Messenger of Allah'), and his prophethood did not end by that erasing. Have I cleared myself of this objection in your view?" They said: "Yes."
Related hadith on this topic