Genesis 26:12-33 English Standard Version (ESV)
12 And Isaac sowed in that land and reaped in the same year a hundredfold. The Lord blessed him, 13 and the man became rich, and gained more and more until he became very wealthy. 14 He had possessions of flocks and herds and many servants, so that the Philistines envied him. 15 (Now the Philistines had stopped and filled with earth all the wells that his father's servants had dug in the days of Abraham his father.) 16 And Abimelech said to Isaac, “Go away from us, for you are much mightier than we.”
17 So Isaac departed from there and encamped in the Valley of Gerar and settled there. 18 And Isaac dug again the wells of water that had been dug in the days of Abraham his father, which the Philistines had stopped after the death of Abraham. And he gave them the names that his father had given them. 19 But when Isaac's servants dug in the valley and found there a well of spring water, 20 the herdsmen of Gerar quarreled with Isaac's herdsmen, saying, “The water is ours.” So he called the name of the well Esek,[a] because they contended with him. 21 Then they dug another well, and they quarreled over that also, so he called its name Sitnah.[b] 22 And he moved from there and dug another well, and they did not quarrel over it. So he called its name Rehoboth,[c] saying, “For now the Lord has made room for us, and we shall be fruitful in the land.”
23 From there he went up to Beersheba. 24 And the Lord appeared to him the same night and said, “I am the God of Abraham your father. Fear not, for I am with you and will bless you and multiply your offspring for my servant Abraham's sake.” 25 So he built an altar there and called upon the name of the Lord and pitched his tent there. And there Isaac's servants dug a well.
26 When Abimelech went to him from Gerar with Ahuzzath his adviser and Phicol the commander of his army, 27 Isaac said to them, “Why have you come to me, seeing that you hate me and have sent me away from you?” 28 They said, “We see plainly that the Lord has been with you. So we said, let there be a sworn pact between us, between you and us, and let us make a covenant with you, 29 that you will do us no harm, just as we have not touched you and have done to you nothing but good and have sent you away in peace. You are now the blessed of the Lord.” 30 So he made them a feast, and they ate and drank. 31 In the morning they rose early and exchanged oaths. And Isaac sent them on their way, and they departed from him in peace. 32 That same day Isaac's servants came and told him about the well that they had dug and said to him, “We have found water.” 33 He called it Shibah;[d] therefore the name of the city is Beersheba to this day.