Sahih al-Bukhari, Book 30, Hadith 107 (In-Book)

Narrated Aisha: Quraish used to fast on the day of 'Ashura' in the Pre-Islamic period, and Allah's Messenger too, used to fast on that day. When he came to Medina, he fasted on that day and ordered others to fast, too. Later when the fasting of the month of Ramadan was prescribed, he gave up fasting on the day of 'Ashura' and it became optional for one to fast on it or not.

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ كَانَ يَوْمُ عَاشُورَاءَ تَصُومُهُ قُرَيْشٌ فِي الْجَاهِلِيَّةِ، وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَصُومُهُ، فَلَمَّا قَدِمَ الْمَدِينَةَ صَامَهُ، وَأَمَرَ بِصِيَامِهِ، فَلَمَّا فُرِضَ رَمَضَانُ تَرَكَ يَوْمَ عَاشُورَاءَ، فَمَنْ شَاءَ صَامَهُ، وَمَنْ شَاءَ تَرَكَهُ‏.‏

sunnah.com