Sahih al-Bukhari 3387
Sahih al-Bukhari · Book 60: Prophets · The Statement of Allah Taa'la: "Verily, in Yusuf and his brethren there were Ayat..."
Narrated Abu Huraira:
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدِ بْنِ أَسْمَاءَ ابْنِ أَخِي جُوَيْرِيَةَ حَدَّثَنَا جُوَيْرِيَةُ بْنُ أَسْمَاءَ ، عَنْ مَالِكٍ ، عَنِ الزُّهْرِيِّ ، أَنَّ سَعِيدَ بْنَ الْمُسَيَّبِ ، وَأَبَا، عُبَيْدٍ أَخْبَرَاهُ عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " يَرْحَمُ اللَّهُ لُوطًا، لَقَدْ كَانَ يَأْوِي إِلَى رُكْنٍ شَدِيدٍ، وَلَوْ لَبِثْتُ فِي السِّجْنِ مَا لَبِثَ يُوسُفُ ثُمَّ أَتَانِي الدَّاعِي لأَجَبْتُهُ " .
Allah's Messenger (ﷺ) said, "May Allah bestow His Mercy on Lot. He wanted to have a powerful support. If I were to stay in prison (for a period equal to) the stay of Joseph (prison) and then the offer of freedom came to me, then I would have accepted it." (See Hadith No. 591)