It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When the newborn cries out, he will be made an heir."
In one narration the wording is: "That is the jab of Satan; every one of the children of Adam receives it, except Maryam and her son, because when she was born her mother said: 'And I seek refuge for her with You, and for her offspring, from Satan the accursed' [Surah Al Imran: 36], so Satan jabbed at her through a veil."
It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Satan jabs every child of Adam in his side when his mother gives birth to him, except Isa son of Maryam; he (Satan) went to jab him, but jabbed the veil." Sayyiduna Abu Hurayrah (may Allah be pleased with him) said: I have seen this scream that the child lets out when his mother gives birth to him; it is from that (jab of Satan).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الفرائض / 12485