The Prophet ﷺ arrived in Madinah and found the Jews fasting. He asked, "What is this?"They replied, "This is the day on which Allah saved Musa and drowned Pharaoh, so Musa fasted it in gratitude."The Messenger of Allah ﷺ said, "We have more right to Musa than you do." So he fasted that day and ordered that it be fasted.
حدثنا سهل بن أبي سهل حدثنا سفيان بن عيينة عن أيوب عن سعيد بن جبير
قدم النبي ﷺ المدينة فوجد اليهود صياما فقال ما هذا قالوا هذا يوم أنجى الله فيه موسى وأغرق فيه فرعون فصامه موسى شكرا فقال رسول الله ﷺ نحن أحق بموسى منكم فصامه وأمر بصيامه
Graded by Bukhari, Fasting, chapter on fasting the day of Ashura, no. 2004, and Muslim, Fasting, chapter on fasting the day of Ashura, no. 1130, and others, from the hadith of Ayub, from Abdullah bin Saeed bin Jubayr, from his father, with this wording. Muslim also narrated it through another route from Saeed, with this wording.