Language:
كتاب مناقب الأنصار
63
Merits of the Helpers in Madinah (Ansaar)
(26)
Chapter: The days of Pre-Islamic Period of Ignorance
(26)
باب أَيَّامِ الْجَاهِلِيَّةِ
Sahih al-Bukhari 3831

Narrated `Aisha:

'Ashura' (i.e. the tenth of Muharram) was a day on which the tribe of Quraish used to fast in the prelslamic period of ignorance. The Prophet (ﷺ) also used to fast on this day. So when he migrated to Medina, he fasted on it and ordered (the Muslims) to fast on it. When the fasting of Ramadan was enjoined, it became optional for the people to fast or not to fast on the day of Ashura.

حَدَّثَنَا مُسَدَّدٌ، حَدَّثَنَا يَحْيَى، قَالَ هِشَامٌ حَدَّثَنِي أَبِي، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ كَانَ عَاشُورَاءُ يَوْمًا تَصُومُهُ قُرَيْشٌ فِي الْجَاهِلِيَّةِ، وَكَانَ النَّبِيُّ صلى الله عليه وسلم يَصُومُهُ، فَلَمَّا قَدِمَ الْمَدِينَةَ صَامَهُ وَأَمَرَ بِصِيَامِهِ، فَلَمَّا نَزَلَ رَمَضَانُ كَانَ مَنْ شَاءَ صَامَهُ، وَمَنْ شَاءَ لاَ يَصُومُهُ‏.‏
Reference : Sahih al-Bukhari 3831
In-book reference : Book 63, Hadith 57
USC-MSA web (English) reference : Vol. 5, Book 58, Hadith 172
  (deprecated numbering scheme)