Sahih al-Bukhari, Hadith 1881 ⓘ
Narrated Anas bin Malik: The Prophet said, "There will be no town which Ad-Dajjal will not enter except Mecca and Medina, and there will be no entrance (road) (of both Mecca and Medina) but the angels will be standing in rows guarding it against him, and then Medina will shake with its inhabitants thrice (i.e. three earthquakes will take place) and Allah will expel all the non-believers and the hypocrites from it."
حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ، حَدَّثَنَا الْوَلِيدُ، حَدَّثَنَا أَبُو عَمْرٍو، حَدَّثَنَا إِسْحَاقُ، حَدَّثَنِي أَنَسُ بْنُ مَالِكٍ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " لَيْسَ مِنْ بَلَدٍ إِلاَّ سَيَطَؤُهُ الدَّجَّالُ، إِلاَّ مَكَّةَ وَالْمَدِينَةَ، لَيْسَ لَهُ مِنْ نِقَابِهَا نَقْبٌ إِلاَّ عَلَيْهِ الْمَلاَئِكَةُ صَافِّينَ، يَحْرُسُونَهَا، ثُمَّ تَرْجُفُ الْمَدِينَةُ بِأَهْلِهَا ثَلاَثَ رَجَفَاتٍ، فَيُخْرِجُ اللَّهُ كُلَّ كَافِرٍ وَمُنَافِقٍ " .
also referenced under: Book 29, Hadith 15 (In-Book) & Volume 3, Book 30, Hadith 105 (USC-MSA)