Some time later, David defeated the Philistines and subdued them, and he captured Gath and its nearby towns from the Philistines.