Abdullah bin Umar reported,

The people of the pre-Islamic era used to fast on the day of Ashura, and the Messenger of Allah ﷺ and the Muslims fasted it before the fast of Ramadan was made obligatory. When Ramadan was made obligatory, the Messenger of Allah ﷺ said, "Ashura is one of the days of Allah, so whoever wishes may fast it, and whoever wishes may leave it."

Muslim 2642

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا عبد الله بن نمير ح و حدثنا ابن نمير واللفظ له حدثنا أبي حدثنا عبيد الله عن نافع أخبرني

عبد الله بن عمر رضي الله عنهما

أن أهل الجاهلية كانوا يصومون يوم عاشوراء وأن رسول الله ﷺ صامه والمسلمون قبل أن يفترض رمضان فلما افترض رمضان قال رسول الله ﷺ إن عاشوراء يوم من أيام الله فمن شاء صامه ومن شاء تركه

مسلم 2642صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Fasting
Chapter
Fasting on the day of Ashura
Numbering
Darussalam 2642
Muslim 2642