Thereafter, Hazrat ‘Ali (radhiyallahu ‘anhu) began returning all the amaanaat and trusts, which the people of Makkah had left in the safekeeping of Rasulullah (sallallahu ‘alaihi wasallam), to their owners. After fulfilling this responsibility, which was assigned to him by Rasulullah (sallallahu ‘alaihi wasallam), he departed from Makkah Mukarramah on his journey of hijrah to Madinah Munawwarah. He would remain in hiding throughout the day and travel at night. Hazrat ‘Ali (radhiyallahu ‘anhu) had no animal to serve as a conveyance, and hence he performed his hijrah on foot.
When Hazrat ‘Ali (radhiyallahu ‘anhu) eventually arrived in Madinah Munawwarah, Rasulullah (sallallahu ‘alaihi wasallam) was filled with joy and called for Hazrat ‘Ali (radhiyallahu ‘anhu). However, on account of the long journey which Hazrat ‘Ali (radhiyallahu ‘anhu) had made on foot, his feet had become swollen and were bleeding, due to which he was unable to walk. Thus, instead of him coming to Rasulullah (sallallahu ‘alaihi wasallam), Rasulullah (sallallahu ‘alaihi wasallam) went to him, and on seeing the condition of his feet, Rasulullah (sallallahu ‘alaihi wasallam) began to tear out of compassion and sympathy.
Rasulullah (sallallahu ‘alaihi wasallam) then placed some of his blessed saliva on his hands and thereafter applied it to the feet of Hazrat ‘Ali (radhiyallahu ‘anhu). Rasulullah (sallallahu ‘alaihi wasallam) also made du‘aa for the feet of Hazrat ‘Ali (radhiyallahu ‘anhu) to heal and recover from this injury.
As a result of the blessed saliva of Rasulullah (sallallahu ‘alaihi wasallam) being applied to his feet, and Rasulullah (sallallahu ‘alaihi wasallam) making du‘aa for his feet, Hazrat ‘Ali (radhiyallahu ‘anhu) never again suffered with pain in his feet, until the day he was martyred.
(Usdul Ghaabah 3/285 and Musnad-e-Ahmed #3251)