When Allah created Adam, He ordered him to go to a group of angels and greet them with peace and then listen to their response to his greeting because that would be the prescribed greeting for him and his offspring after him who follow the religion of the messengers. So he said: As-Salāmu ‘alaykum (peace be upon you), and they replied: As-Salāmu ‘alayk wa rahmatullāh (peace and mercy of Allah be upon you), adding 'rahmatullāh' (mercy of Allah). This has, thus, become the prescribed wording when greeting and returning the greeting. Other Hadīths had the addition: "wa rahmatullāh wa barakātuh (...and mercy of Allah and His blessings be upon you!)"