The Prophet ﷺ came to Medina and saw the Jews fasting on the day of Ashura. He asked them about that. They replied, "This is a good day, the day on which Allah rescued Bani Israel from their enemy. So, Moses fasted this day." The Prophet ﷺ said, "We have more claim over Moses than you." So, the Prophet fasted on that day and ordered (the Muslims) to fast (on that day). (Using translation from Bukhārī 2004)
قَدِمَ رَسُولُ اللهِ ﷺ الْمَدِينَةَ فَرَأَى الْيَهُودَ يَصُومُونَ يَوْمَ عَاشُورَاءَ فَقَالَ مَا هَذَا الْيَوْمُ الَّذِي تَصُومُونَ؟ قَالُوا هَذَا يَوْمٌ صَالِحٌ هَذَا يَوْمٌ نَجَّى اللهُ بَنِي إِسْرَائِيلَ مِنْ عَدُوِّهِمْ قَالَ فَصَامَهُ مُوسَى قَالَ رَسُولُ اللهِ ﷺ أَنَا أَحَقُّ بِمُوسَى مِنْكُمْ قَالَ فَصَامَهُ رَسُولُ اللهِ ﷺ وَأَمَرَ بِصَوْمِهِ