Abdullah bin Abbas reported,

The Messenger of Allah ﷺ arrived in Medina and found the Jews fasting on the day of Ashura. The Messenger of Allah ﷺ asked them, "What is this day on which you are fasting?"They replied, "This is a great day. On it Allah saved Musa and his people and drowned Pharaoh and his people, so Musa fasted it in gratitude, and we fast it as well."The Messenger of Allah ﷺ said, "We have a greater claim to Musa than you do." So the Messenger of Allah ﷺ fasted on that day and ordered that it be observed as a fast.

Azami 4489

Sahih

عن عبد الله بن عباس

أن رسول الله ﷺ قدم المدينة، فوجد اليهود صياما، يوم عاشوراء. فقال لهم رسول الله ﷺ: ما هذا اليوم الذي تصومونه؟ فقالوا: هذا يوم عظيم. أنجى الله فيه موسى وقومه، وغرق فرعون وقومه، فصامه موسى شكرا، فنحن نصومه. فقال رسول الله ﷺ: فنحن أحق وأولى بموسى منكم فصامه رسول الله ﷺ وأمر بصيامه.

الأعظمي 4489صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Voluntary fasting and encouragement to do it
Section
Explanation of the reason for fasting on the day of Ashura
Numbering
Jami al-Kamil 4489 (2nd edition)
Azami 4489