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, 'Indeed, I am ill' [Saffat 37:89], and when he said, 'Rather, this, their biggest one, 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, 'If this tyrant 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 other than you and me.'When he entered that 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, while Ibrahim
stood up to pray. When she came in to him, he could not restrain himself and reached out his hand toward her, but 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, but he went back to her, and his hand was seized more tightly than the first time. He said the same thing to her, and she did so, but he went back to her again, and his hand was seized more tightly than on the first two occasions.He said, 'Pray to Allah to release my hand. I give you Allah's covenant that I will not harm you.'She did so, and his hand was released. Then he summoned 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.'So she came walking back, and when Ibrahim
saw her, he turned from his prayer and asked her, 'What happened?'She replied, 'All is well. Allah restrained the wicked man's hand, and he gave me a servant.'"Abu Hurairah then 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 routes from Ayub Sakhtiyani, from Muhammad bin Sirin, from Abu Hurairah, who mentioned it. This is the wording of Muslim.