Dhakwan (may Allah have mercy on him) narrates from Sayyiduna Mu'awiyah bin Abi Sufyan (may Allah be pleased with him); he said: When the Messenger of Allah (peace and blessings be upon him) heard the mu'adhdhin say "Allahu akbar" (Allah is the Greatest), he would say the same; when he said "Ashhadu an la ilaha illallah" (I bear witness that there is no god but Allah), he (peace and blessings be upon him) would also say the same; and when he said "Ashhadu anna Muhammadan rasulullah" (I bear witness that Muhammad is the Messenger of Allah) twice, he (peace and blessings be upon him) would also say the same.
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 16819