After completing tashahhud of the last rakʿah of the prayer, it is recommended that while one is sitting and his body is still, he should say: اَلسَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ assalāmu ʿalayka ayyuhan nabiyyu wa raḥmatul lāhi wa barakātuh Peace be upon you O Prophet, and Allah’s mercy and His blessings (be upon you too). And after that, he must say: اَلسَّلَامُ عَلَيْكُمْ assalāmu ʿalaykum Peace be upon you.
And the recommended precaution is that [after saying assalāmu ʿalaykum,] one adds the sentence: وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ wa raḥmatul lāhi wa barakātuh And Allah’s mercy and His blessings (be upon you too). Or [i.e. instead of saying assalāmu ʿalaykum], one must say: اَلسَّلَامُ عَلَيْنَا وَعَلَىٰ عِبَادِ اللهِ الصَّالِحِيْنَ assalāmu ʿalaynā wa ʿalā ʿibādil lāhiṣ ṣāliḥīn Peace be upon us and upon the righteous servants of Allah.
However, if he says this, then the obligatory precaution is that he must also say after it: اَلسَّلَامُ عَلَيْكُمْ assalāmu ʿalaykum Peace be upon you.