[Machine] The Prophet Muhammad ﷺ used to say the same words as the Mu'adhin (the caller to prayer) when he heard him say "Allahu Akbar" (Allah is the greatest). And when the Mu'adhin said "Ashhadu an la ilaha illa Allah" (I bear witness that there is no god but Allah), the Prophet Muhammad would say the same words. And when the Mu'adhin said "Ashhadu anna Muhammadan Rasul Allah" (I bear witness that Muhammad is the Messenger of Allah), the Prophet Muhammad would also say the same words.
كَانَ رَسُولُ اللهِ ﷺ إِذَا سَمِعَ الْمُؤَذِّنَ يَقُولُ اللهُ أَكْبَرُ قَالَ مِثْلَ قَوْلِهِ فَإِذَا قَالَ أَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللهُ قَالَ مِثْلَ قَوْلِهِ فَإِذَا قَالَ أَشْهَدُ أَنَّ مُحَمَّدًا رَسُولُ اللهِ مَرَّتَيْنِ قَالَ مِثْلَ قَوْلِهِ