The prophet Muhammad had whispered to Ali's servant that Ali would die by the servant's own hand.
The servant begged Ali to slay him instead. "Let me not commit this terrible sin!" said the servant, weeping.
But Ali replied, "I won't attempt to evade what is fated for me by God."
"Let it fall to someone else!" pleaded the servant. "Slay me now, and then another may carry out God's will."
Again Ali refused. "God's word is written, and the ink of the Pen of Fate is dry. The deed is not yours, but God's doing: it is all One."
Inspired by: The English prose version of Rumi in Tales from the Masnavi by A. J. Arberry.
Notes: This is an aside in story 19 in the book, describing Ali's encounter with a Zoroastrian knight: Ali and the Knight. I am not sure what the source of this particular legend is. Ali was assassinated by Abd-al-Rahman ibn Muljam in Kufa in 661 (AH 40); you can read more at Wikipedia.