The children of Israel again did that which was evil in the sight of Yahweh; and Yahweh delivered them into the hand of the Philistines forty years.
In the history of Israel, the Philistines appeared very early as an obstacle in the way of what Israel desired to do.  When Moses led Israel out of Egypt, the Philistines were spread out along the coastal strip between Egypt and Gaza, causing Moses to detour inland to "avoid the way of the Philistines"  (Exodus 13:17), the date of the Exodus being 1441 B.C.