Shaaraim (or Sha'arayim, Hebrew: שַׁעֲרַ֫יִם; meaning 'two gates') is a biblical site mentioned three times in the Old Testament, allotted to the tribe of Judah. Shaaraim has been identified by Yosef Garfinkel as the ancient site of Khirbet Qeiyafa, located 30 kilometers southwest of Jerusalem.
Yosef Garfinkel has plausibly identified Shaaraim with the site of Khirbet Qeiyafa, an ancient city that existed between 1020 - 980 BC, revealing its end coincides with the latter part of the reign of David. Khirbet Qeiyafa is the only site up until its time to have two gates, and Shaaraim means 'two gates', thus Yosef Garfinkel finds that the only contender for Shaaraim must be Khirbet Qeiyafa. Khirbet Qeiyafa is a "a key strategic location in the biblical Kingdom of Judah, on the main road from Philistia and the Coastal Plain to Jerusalem and Hebron in the hill country." Khirbet Qeiyafa was a heavily fortified site in its time, and has potentially ended the debate about the historicity of the kingdom of David, revealing that David ruled over a large and powerful centralized administration in his time.
The ancient city of Shaaraim is mentioned three times in the Old Testament; 1 Samuel 17:52, Joshua 15:36, and 1 Chronicles 4:31.
1 Samuel 17:52: The men of Israel and Judah arose and shouted and pursued the Philistines as far as the valley, and to the gates of Ekron. And the slain Philistines lay along the way to Shaaraim, even to Gath and Ekron.
Joshua 15:36: and Shaaraim and Adithaim and Gederah and Gederothaim; fourteen cities with their villages.
1 Chronicles 4:31: Beth-marcaboth, Hazar-susim, Beth-biri and Shaaraim. These were their cities until the reign of David.
1 Samuel 17:52 is in the context of the battle between David and Goliath, where after David slays Goliath, the Israelite's are said to have pursued the Philistines past the city of Shaaraim. Joshua 15:36 reveals that Shaaraim was allotted to the tribe of Judah, and 1 Chronicles 4:31 tells us that Shaaraim existed as a city until the reign of David, where it would eventually cease during his reign.