When the Prophet ﷺ arrived in Medina, he found them fasting on a particular day, namely Ashura. They said, "This is a great day. It is the day on which Allah saved Musa and drowned the people of Pharaoh, so Musa fasted it in gratitude to Allah."He said, "I have more right to Musa than they do." So he fasted it and ordered that it be fasted.
حدثنا علي بن عبد الله حدثنا سفيان حدثنا أيوب السختياني عن ابن سعيد بن جبير عن أبيه
أن النبي ﷺ لما قدم المدينة وجدهم يصومون يوما يعني عاشوراء فقالوا هذا يوم عظيم وهو يوم نجى الله فيه موسى وأغرق آل فرعون فصام موسى شكرا لله فقال أنا أولى بموسى منهم فصامه وأمر بصيامه