Joshua 15:44 includes Keilah among the towns allotted to Judah in the Shephelah.
First Samuel 23 provides the principal biblical account concerning the city. David learned that the Philistines were attacking Keilah and robbing its threshing floors. After seeking God's direction, David and his men attacked the Philistines and rescued the inhabitants.
Saul subsequently learned that David was inside the fortified town and planned to surround him. David consulted the Lord through Abiathar and learned that the leaders of Keilah would surrender him to Saul. David and his men therefore left the town before Saul arrived.
After the Babylonian exile, leaders associated with districts of Keilah participated in rebuilding the walls of Jerusalem under Nehemiah.