The Prophet ﷺ said, "Allah wrote a book two thousand years before He created the heavens and the earth, and from it He sent down two verses with which He concluded Surah al-Baqarah. They are not recited in any house for three nights without a devil drawing near to it."
عن النبي ﷺ قال: إن الله كتب كتابا قبل أن يخلق السماوات والأرض بألفي عام، وأنزل منه آيتين ختم بهما سورة البقرة، ولا يقرآن في دار ثلاث ليال فيقربها شيطان.
Tirmidhi (2882) narrated it from Muhammad bin Bashshar, who said, Abdul-Rahman bin Mahdi told us, Hammad bin Salama told us, from Ashath bin Abdul-Rahman Jarmi, from Abu Qilaba, from Abu Ashath Jarmi, from Numan bin Bashir, from the Prophet ﷺ, and he related it.Ibn Hibban (782) graded it sahih, as did Hakim (1/562, 2/260), both by way of Hammad bin Salama, with his chain, in similar wording, except that Ibn Hibban did not mention the writing of the decrees two thousand years before the creation of the heavens and the earth. Hakim said in the first place, "Its chain is sahih." And he said in the second place, "Sahih according to the criterion of Muslim." In the second place a mistake occurred from him, may Allah have mercy on him, for Ashath bin Abdul-Rahman Jarmi is not among the narrators of Muslim, rather Abu Dawud, Tirmidhi, and Nasai narrated from him, and he is "truthful." Tirmidhi said, "Hasan gharib." I say, it is as he said, for its chain is hasan on account of Ashath bin Abdul-Rahman Jarmi.By this same route, Imam Ahmad also recorded it (18414), as did Firyabi in al-Qadar (88), and Darimi in his Sunan (3430), among others.But Tabarani narrated it in al-Kabir (7146) by this same route, making it a narration from Abu Qilaba, from Abu Asma, from Shaddad bin Aws, from the Messenger of Allah ﷺ, relating it similarly.This hadith contradicts what is established in Sahih Muslim, "with fifty thousand years." The two cannot be reconciled except with strain, and this is why Baghawi said in his commentary (1201), "Gharib." And it is as he said, for what is in the Sahih is more sound.