Answered by Sayyidi al-Ḥabīb `Umar bin Hafīẓ (may Allāh preserve him and benefit us by him).
How do we reconcile between the mercy that the Prophet showed towards the disbelievers and the supplication that we read in the litany of Imam Abū Bakr al-Sakrān: ‘deflect their gaze and turn it away from us..’?
This supplication is for protection from a specific category of people, namely those who have wicked intentions from among mankind and jinn-kind. For their gaze to be deflected is in reality a mercy for them. This is similar to some of the supplications that the Prophet made when he prayed against those who had wicked intentions and opposed him, such as: “O Allāh defeat them and shake them!” All of this is encompassed in the general meaning of mercy. It was appropriate for the state which he was in, placing everything in its correct context.
[The litany of Imam Abū Bakr al-Sakrān can be found in Khulāsat al-Madad after Surah Ya Sin. It is a short but very powerful litany that should be read daily for protection from all types of evil].