When the Messenger of Allah ﷺ arrived in Madinah, he found the Jews fasting on the day of Ashura. The Messenger of Allah ﷺ asked them, "What is this day on which you fast?"They replied, "This is a great day. Allah saved Musa and his people on it 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 that day and instructed others to fast it.
و حدثني ابن أبي عمر حدثنا سفيان عن أيوب عن عبد الله بن سعيد بن جبير عن أبيه
أن رسول الله ﷺ قدم المدينة فوجد اليهود صياما يوم عاشوراء فقال لهم رسول الله ﷺ ما هذا اليوم الذي تصومونه فقالوا هذا يوم عظيم أنجى الله فيه موسى وقومه وغرق فرعون وقومه فصامه موسى شكرا فنحن نصومه فقال رسول الله ﷺ فنحن أحق وأولى بموسى منكم فصامه رسول الله ﷺ وأمر بصيامه