Iyād, and stated that it might occur at separate times (1).
The hadith scholar Ibn Hajar stated that both periods might be intended:
The first was the Prophet’s time (may Allah bless him and grant him peace), as evidenced by the account of the Bedouin related by al-Bukhārī from Jābir (may Allah be pleased with him): A Bedouin came to the Prophet (may Allah bless him and grant him peace) and pledged allegiance to him upon Islam. He returned the following day suffering from fever and said, “Release me from my pledge.” The Prophet refused him three times. He then said, “Medina is like a furnace: it casts out its impurities, while its good people are purified.” (2)
The second is the time of the Dajjāl, as related in the hadith of Anas ibn Mālik (may Allah be pleased with him), in which the Prophet (may Allah bless him and grant him peace) mentioned the Dajjāl and then said, “Then Medina will shake with its inhabitants three times, whereupon Allah will drive out to him every disbeliever and hypocrite.”
Al-Bukhārī narrated it (3).
As for the periods between these two, that is not the case. Many eminent Companions left Medina after the Prophet (may Allah bless him and grant him peace), including Muādh ibn Jabal, Abū Ubayda, Ibn Masūd, and a number of others. Later, Alī, Talha, al-Zubayr, Ammār, and others also left, although they were among the finest of people. This indicates that the hadith applies to certain people rather than others, and to a particular time rather than another, as evidenced by the words of Allah Most High: “And among the people of Medina are some who persist in