The Messenger of Allah ﷺ said, "Ibrahim the Prophet never told a lie except on three occasions. Two of them were for the sake of Allah, when he said, 'I am indeed sick' [Saffat 37:89], and when he said, 'Rather, it was this, the biggest of them, that did it' [Anbiya 21:63]. The third concerned Sarah.He once came to the land of a tyrant, and Sarah was with him. She was the most beautiful of people, so he said to her, "This tyrant, if he learns that you are my wife, he will overpower me and take you. So if he asks you, tell him that you are my sister, for you are indeed my sister in Islam. I know of no Muslim on earth besides you and me."When he entered the tyrant's land, one of the tyrant's men saw her and went to him and said, "A woman has come to your land who is fit for no one but you."So he sent for her and she was brought to him. Ibrahim
stood up to pray. When she came before the tyrant, he could not restrain himself from reaching out his hand toward her, and his hand was seized and held fast.He said to her, "Pray to Allah to release my hand, and I will not harm you."She did so, and he tried again, and his hand was seized more tightly than the first time. He said the same thing to her, and she prayed again, and again he tried, and this time his hand was seized more tightly than on either of the first two occasions.He said, "Pray to Allah to release my hand. Allah is your guarantee that I will not harm you."She did so, and his hand was released. Then he called for 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 Hagar."She came back walking, and when Ibrahim
saw her he broke off his prayer and said to her, "How did it go?"She replied, "All is well. Allah restrained the hand of the wicked man, and he provided a servant."Abu Hurairah said, "That is your mother, sons of the water of heaven."
أن رسول الله ﷺ قال: لم يكذب إبراهيم النبي عليه السلام قط إلا ثلاث كذبات: ثنتين في ذات الله قوله {إني سقيم}، وقوله: {قال بل فعله كبيرهم هذا}[سورة الأنبياء: ٦٣]، وواحدة في شأن سارة، فإنه قدم أرض جبار، ومعه سارة، وكانت أحسن الناس، فقال لها: إن هذا الجبار إن يعلم أنك امرأتي يغلبني عليك، فإن سألك فأخبريه أنك أختي، فإنك أختي في الإسلام، فإني لا أعلم في الأرض مسلما غيري وغيرك، فلما دخل أرضه رآها بعض أهل الجبار، أتاه، فقال له: لقد قدم أرضك امرأة لا ينبغي لها أن تكون إلا لك. فأرسل إليها، فأتى بها، فقام إبراهيم عليه السلام إلى الصلاة، فلما دخلت عليه لم يتمالك أن بسط يده إليها، فقبضت يده قبضة شديدة، فقال لها: ادعي الله أن يطلق يدي ولا أضرك. ففعلت، فعاد، فقبضت أشد من القبضة الأولى، فقال لها مثل ذلك، ففعلت، فعاد، فقبضت أشد من القبضتين الأوليين، فقال: ادعي الله أن يطلق يدي، فلك الله أن لا أضرك. ففعلت، وأطلقت يده، ودعا الذي جاء بها، فقال له: إنك إنما أتيتني بشيطان، ولم تأتني بإنسان، فأخرجها من أرضي وأعطها هاجر. قال: فأقبلت تمشي، فلما رآها إبراهيم عليه السلام انصرف، فقال لها: مهيم؟ قالت: خيرا، كف الله يد الفاجر، وأخدم خادما. قال أبو هريرة: فتلك أمكم، يا بني ماء السماء.
Bukhari narrated it in the Hadiths of the Prophets (3357, 3358), and Muslim in the Virtues (2371:154), both through routes from Ayub Sakhtiyani, from Muhammad bin Sirin, from Abu Hurairah, who mentioned it, and this is the wording of Muslim.