وله غير ذلك، تولى الخطابة والإمامة بجامع القرويين بعد وفاة الشيخ الهواري سنة 1022 ه ورحل للشرق في رمضان سنة 1027 ه ونال بتلك الجهة حظوة وجاها فوق ما يذكر وطار صيته وحج خمس حجج وأقرأ هناك الحديث وغيره وتردد على دمشق ومصر وتزوج بها من السادات الوفائية وسبب خروجه من فاس أن سلطانها طلب من العلماء فتوى في أمر نزل وإعطاء العرائش للنصارى فأفتى من أفتى وهرب جماعة منهم صاحب الترجمة وأبو عبد الله الجنان والحسن الزياتي شارح الجمل وأبو العباس أحمد الفاسي ولما دخل دمشق أعجبته وأقرأ دروسا هناك وأملى صحيح البخاري بالجامع الأموي تحت قبة النسر بعد صلاة الصبح ولما كثر الناس بعد أيام خرج إلى صحن الجامع وحضره غالب أعيان علماء دمشق وأما الطلبة فلم يتخلف منهم أحد وكان يوم ختمه حافلا جدا اجتمع فيه الألوف من الناس وتكلم بكلام في العقائد والحديث لم يسمع نظيره وعلت الأصوات بالبكاء فنقلت حفلة الدرس إلى وسط الصحن وأتي له بكرسي الوعظ وأخيرا أتى بأبيات قالها حين ودع المصطفى - صلى الله عليه وسلم -وترجم للبخاري وأنشد له بيتين وأفاد أن ليس للبخاري غيرهما وهما:
And he has other things. He took charge of the preaching and the imamate at the Qarawiyyin Mosque after the death of Shaykh al-Hawwari in the year 1022 AH, and he travelled to the East in Ramadan of the year 1027 AH. In that region he attained favour and standing beyond what can be told, and his fame spread far. He performed the pilgrimage five times and taught hadith and other things there. He went back and forth to Damascus and Egypt, and there he married into the Wafaʾi masters. The cause of his leaving Fez was that its sultan asked the scholars for a fatwa on an affair that had occurred, the giving of al-ʿAraʾish to the Christians; some gave the fatwa, and a group fled, among them the subject of this biography, Abu ʿAbd Allah al-Jannan, al-Hasan al-Zayyati, the commentator on al-Jumal, and Abu l-ʿAbbas Ahmad al-Fasi. When he entered Damascus it pleased him; he gave lessons there and dictated the Sahih of al-Bukhari at the Umayyad Mosque under the Eagle Dome (Qubbat al-Nasr) after the dawn prayer. When the people grew many after some days, he went out to the courtyard of the mosque, and most of the notable scholars of Damascus attended him; as for the students, not one of them stayed away. The day of his completion [of the book] was very well attended; thousands of people gathered at it, and he spoke words on creeds and hadith the like of which had not been heard, and voices rose in weeping. The gathering of the lesson was moved to the middle of the courtyard and the preaching chair was brought for him. Finally he recited verses that he had composed when he bade farewell to the Chosen One - God bless him and grant him peace -, and he gave the biography of al-Bukhari and recited two verses of his, stating that al-Bukhari has none but these two; and they are:
اغتنم في الفراغ فضل ركوع ... فعسى أن يكون موتك بغته
Seize, in your leisure, the merit of a bowing [in prayer] ... for perhaps your death will come suddenly.
كم صحيح قد مات قبل سقيم ... ذهبت نفسه النفيسة فلته
How many a healthy man has died before a sick one ... his precious soul departing suddenly!
قال الحافظ ابن حجر: وقع للبخاري ذلك أو قريب منه وهذا من الغرائب وكانت جلسة الدرس من طلوع الشمس إلى قرب الظهر وبعد ذكره أبيات التوديع المشار لها نزل عن الكرسي فازدحم الناس على تقبيل يده وكان ذلك نهار الأربعاء سابع عشر رمضان سنة 1037 ه وتوفي بمصر في جمادى الآخرة سنة 1041 ه ودفن بمقبرة المجاورين.
The hafiz Ibn Hajar said: That, or something close to it, befell al-Bukhari, and this is one of the marvels. The session of the lesson lasted from sunrise until near noon, and after his recitation of the farewell verses referred to, he came down from the chair and the people crowded to kiss his hand. That was on Wednesday, the seventeenth of Ramadan of the year 1037 AH. He died in Egypt in Jumada al-Akhira of the year 1041 AH and was buried in the cemetery of al-Mujawirin.