Sarah stood and made wudu and prayed. In Sahih al-Bukhari 2217 she asked Allah: if she believed in Him and in His messenger, and had guarded her chastity except from her husband, then He should not give this disbeliever power over her.
The tyrant was seized. In Sahih al-Bukhari 3358 he reached to take hold of her with his hand and was seized, and in Sahih Muslim 2371 his hand was clenched tightly. He asked her to pray to Allah for him and promised not to harm her. She prayed and he was released. In Sahih Muslim 2371 this was repeated three times, each time stronger than the last (Sahih al-Bukhari 3358 mentions two).
Then the king called one of his attendants and said that they had not brought him a human being but a devil. He returned Sarah to Ibrahim and gave her Hajar as a servant.
When Sarah came back, Ibrahim was standing in prayer. He signalled to ask what had happened. She told him that Allah had turned back the plot of the disbeliever, and that the king had given a servant. Abu Hurayrah then said, "That is your mother, O children of the water of the sky," a phrase that scholars explain as addressing the Arabs.