كتاب الحج
15  
The Book of Pilgrimage
(85)
Chapter: The virtue of Al-Madinah and the Prophet's Prayer for it to be blessed. Its sanctity and the sanctity of its game and trees. The Boundaries of its sanctuary
(85)
باب فَضْلِ الْمَدِينَةِ وَدُعَاءِ النَّبِيِّ صلى الله عليه وسلم فِيهَا بِالْبَرَكَةِ وَبَيَانِ تَحْرِيمِها وَتَحْرِيمِ صَيْدِهَا وَشَجَرِهَا وَبَيَانِ حُدُودِ حَرَمِهَا
Sahih Muslim 1372 b

Abu Huraira (Allah be pleased with him) reported that Allah's Messenger (ﷺ) declared sacred the territory between two lava mountains of Medina. Abu Huraira said:

If I were to find deer in the territory between the two mountains, I would not molest them, and he (the Holy Prophet) declared twelve miles of suburb around Medina as a prohibited pasture.
وَحَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، وَمُحَمَّدُ بْنُ رَافِعٍ، وَعَبْدُ بْنُ حُمَيْدٍ، قَالَ إِسْحَاقُ أَخْبَرَنَا عَبْدُ الرَّزَّاقِ، حَدَّثَنَا مَعْمَرٌ، عَنِ الزُّهْرِيِّ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ حَرَّمَ رَسُولُ اللَّهِ صلى الله عليه وسلم مَا بَيْنَ لاَبَتَىِ الْمَدِينَةِ ‏.‏ قَالَ أَبُو هُرَيْرَةَ فَلَوْ وَجَدْتُ الظِّبَاءَ مَا بَيْنَ لاَبَتَيْهَا مَا ذَعَرْتُهَا ‏.‏ وَجَعَلَ اثْنَىْ عَشَرَ مِيلاً حَوْلَ الْمَدِينَةِ حِمًى ‏.‏
Reference : Sahih Muslim 1372b
In-book reference : Book 15, Hadith 537
USC-MSA web (English) reference : Book 7, Hadith 3169
  (deprecated numbering scheme)