The Messenger of Allah ﷺ said, "Ibrahim the Prophet never told a lie except for three. Two were for the sake of Allah, his saying, 'I am sick,' and his saying, 'Rather, this big one of theirs did it.' And one concerned Sarah.He came to the land of a tyrant, and Sarah was with him. She was the most beautiful of people. He said to her, 'If this tyrant learns that you are my wife, he will overpower me to take you. If he asks you, tell him you are my sister, for indeed you are my sister in Islam. I know of no Muslim on earth other than myself and you.'When he entered the tyrant's land, one of the tyrant's people saw her, went to him, and said, 'A woman has come to your land who is fit for none but you.' So he sent for her, and she was brought to him. Ibrahim
stood up to pray.When she entered upon the tyrant, he could not restrain himself from stretching out his hand toward her, but his hand was seized in a powerful grip. He said to her, 'Pray to Allah to release my hand, and I will not harm you.' She prayed, and he was released. Then he reached out again, and his hand was seized more tightly than the first time. He said the same thing to her, she prayed, and he was released. Then he reached out a third time, and his hand was seized more tightly than the previous two times. He said, 'Pray to Allah to release my hand, and I promise not to harm you.' She prayed, and his hand was released.He then called the man who had brought her and said to him, 'You have brought me a devil, not a human being. Take her out of my land, and give her Hajar.'She came walking back. When Ibrahim
saw her, he turned from his prayer and said to her, 'What happened?'She replied, 'All is well. Allah has restrained the hand of the wicked man, and he gave me a servant.'"Abu Hurairah said, "That is your mother, sons of the water of the sky."
أن رسول الله ﷺ قال: لم يكذب إبراهيم النبي عليه السلام قط إلا ثلاث كذبات: ثنتين في ذات الله قوله إني سقيم وقوله: بل فعله كبيرهم هذا، وواحدة في شأن سارة فإنه قدم أرض جبار ومعه سارة وكانت أحسن الناس فقال لها هذا الجبار إن يعلم أنك امرأتي يغلبني عليك فإن سألك فأخبريه أنك أختي فإنك أختي في الإسلام فإني لا أعلم في الأرض مسلما غيري وغيرك فلما دخل أرضه رآها بعض أهل الجبار فأتاه فقال له لقد قدم أرضك امرأة لا ينبغي لها أن تكون إلا لك فأرسل إليها فأتي بها فقام إبراهيم عليه السلام إلى الصلاة فلما دخلت عليه لم يتمالك أن بسط يده إليها فقبضت يده قبضة شديدة فقال لها: ادعي الله أن يطلق يدي ولا أضرك فدعت فعل فأطلقت فعاد فقبضت أشد من القبضة الأولى فقال لها مثل ذلك: فدعت فعل فأطلقت فعاد فقبضت أشد من القبضتين الأوليين فقال: ادعي الله أن يطلق يدي فلك أن لا أضرك فدعت وأطلقت يده ودعا الذي جاء بها فقال له: إنك إنما أتيتني بشيطان ولم تأتني بإنسان فأخرجها من أرضي وأعطها هاجر قال: فأقبلت تمشي فلما رآها إبراهيم عليه السلام انصرف فقال لها: مهيم قالت: خيرا كف الله يد الفاجر وأخدم خادما. قال أبو هريرة: فتلك أمكم يا بني ماء السماء.
Bukhari narrated it in the chapters on the prophets (3357, 3358), and Muslim in the chapter on virtues (2371:154), both through the routes of Ayub Sakhtiyani, from Muhammad bin Sirin, from Abu Hurairah, who related it. This is the wording of Muslim, while in Bukhari's account the one who first entered upon the king was Ibrahim , followed by Sarah, and his wording is as follows, "There is here a man accompanied by a woman who is among the most beautiful of people." So he sent for him and asked him about her, saying, "Who is this?" He said, "She is my sister." Then he went to Sarah and said, "O Sarah, there is no believer on the face of the earth other than myself and you, and this man asked me about you, so I told him that you are my sister. Do not contradict me." So he sent for her...As for his saying, "There is no believer on the face of the earth other than myself and you," this means on the face of the land of Egypt where he was, otherwise Lut had already believed in him before that, as Allah Most High says, "So Lut believed in him" [Ankabut 29:26], except that Lut was not with him in the land of Egypt.As for his saying, "Ibrahim never lied except three times," this is not a case of genuine lying that would condemn its perpetrator, far from it, never. Rather, the term "lying" was applied to this loosely, and it was actually a form of indirect speech used for a legitimate religious purpose. Ibn Kathir mentioned this in his Tafsir.