وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «صِيَاحُ الْمَوْلُودِ حِينَ يَقَعُ نَزْغَةٌ من الشَّيْطَان»
He also reported God's messenger as saying, "The cry of an infant at the moment of birth is due to a prick from the devil.” (Bukhari and Muslim.)
Related hadith on this topic