Abu Abd al-Rahman al-Sulami says that a woman was brought to Sayyiduna Umar (may Allah be pleased with him) who had been distressed by thirst. She went to a shepherd and asked for water, but the shepherd refused and said: I will give it if you let me have intercourse with you; and she agreed. The people advised that she be stoned, but Sayyiduna Ali (may Allah be pleased with him) said: She was compelled; let her go. So she was let go.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحدود / 17050