Then Samuel spoke to all the house of Israel, saying, “If you return to the LORD with all your hearts, then put away the foreign gods and the Ashtoreths from among you, and prepare your hearts for the LORD, and serve Him only; and He will deliver you from the hand of the Philistines.” So the children of Israel put away the Baals and the Ashtoreths, and served the LORD only.
And Samuel said, “Gather all Israel to Mizpah, and I will pray to the LORD for you.” So they gathered together at Mizpah, drew water, and poured it out before the LORD. And they fasted that day, and said there, “We have sinned against the LORD.” And Samuel judged the children of Israel at Mizpah.
Now when the Philistines heard that the children of Israel had gathered together at Mizpah, the lords of the Philistines went up against Israel. And when the children of Israel heard of it, they were afraid of the Philistines. So the children of Israel said to Samuel, “Do not cease to cry out to the LORD our God for us, that He may save us from the hand of the Philistines.”
And Samuel took a suckling lamb and offered it as a whole burnt offering to the LORD. Then Samuel cried out to the LORD for Israel, and the LORD answered him. Now as Samuel was offering up the burnt offering, the Philistines drew near to battle against Israel. But the LORD thundered with a loud thunder upon the Philistines that day, and so confused them that they were overcome before Israel. And the men of Israel went out of Mizpah and pursued the Philistines, and drove them back as far as below Beth Car. Then Samuel took a stone and set it up between Mizpah and Shen, and called its name Ebenezer, saying, “Thus far the LORD has helped us.”
So the Philistines were subdued, and they did not come anymore into the territory of Israel. And the hand of the LORD was against the Philistines all the days of Samuel. Then the cities which the Philistines had taken from Israel were restored to Israel, from Ekron to Gath; and Israel recovered its territory from the hands of the Philistines. Also there was peace between Israel and the Amorites.
And Samuel judged Israel all the days of his life. He went from year to year on a circuit to Bethel, Gilgal, and Mizpah, and judged Israel in all those places. But he always returned to Ramah, for his home was there. There he judged Israel, and there he built an altar to the LORD.