كتاب الإيمان
1  
The Book of Faith
(65)
Chapter: Clarifying that Islam started as something strange, and will revert to being something strange, and it will retreat between the two Masajid
(65)
باب بَيَانِ أَنَّ الْإِسْلَامَ بَدَأَ غَرِيبًا وَسَيَعُودُ غَرِيبًا وَأَنَّهُ يَأْرِزُ بَيْنَ الْمَسْجِدَيْنِ
Sahih Muslim 146

It is narrated on the authority of Ibn 'Umar ('Abdullah b. 'Umar) that the Messenger of Allah (ﷺ) observed:

Verily Islam started as something strange and it would again revert (to its old position) of being strange just as it started, and it would recede between the two mosques just as the serpent crawls back into its hole.
وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ، وَالْفَضْلُ بْنُ سَهْلٍ الأَعْرَجُ، قَالاَ حَدَّثَنَا شَبَابَةُ بْنُ سَوَّارٍ، حَدَّثَنَا عَاصِمٌ، - وَهُوَ ابْنُ مُحَمَّدٍ الْعُمَرِيُّ - عَنْ أَبِيهِ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِنَّ الإِسْلاَمَ بَدَأَ غَرِيبًا وَسَيَعُودُ غَرِيبًا كَمَا بَدَأَ وَهُوَ يَأْرِزُ بَيْنَ الْمَسْجِدَيْنِ كَمَا تَأْرِزُ الْحَيَّةُ فِي جُحْرِهَا ‏"‏ ‏.‏
Reference : Sahih Muslim 146
In-book reference : Book 1, Hadith 280
USC-MSA web (English) reference : Book 1, Hadith 271
  (deprecated numbering scheme)