About this time, Abimelech came with Phicol, his army commander, to visit Abraham. “God is obviously with you, helping you in everything you do,” Abimelech said. “Swear to me in God’s name that you will never deceive me, my children, or any of my descendants. I have been loyal to you, so now swear that you will be loyal to me and to this country where you are living as a foreigner.”
Abraham replied, “Yes, I swear to it!” Then Abraham complained to Abimelech about a well that Abimelech’s servants had taken by force from Abraham’s servants.
“This is the first I’ve heard of it,” Abimelech answered. “I have no idea who is responsible. You have never complained about this before.”
Abraham then gave some of his sheep, goats, and cattle to Abimelech, and they made a treaty. But Abraham also took seven additional female lambs and set them off by themselves. Abimelech asked, “Why have you set these seven apart from the others?”
Abraham replied, “Please accept these seven lambs to show your agreement that I dug this well.” Then he named the place Beersheba (which means “well of the oath”), because that was where they had sworn the oath.
After making their covenant at Beersheba, Abimelech left with Phicol, the commander of his army, and they returned home to the land of the Philistines. Then Abraham planted a tamarisk tree at Beersheba, and there he worshiped the LORD, the Eternal God. And Abraham lived as a foreigner in Philistine country for a long time.