 Majdal Yaba stood on the site of a walled city in 3000 BCE, and is first mentioned as Aphek in the Ancient Egyptian Execration texts of the 19th century BCE, as well as the 15th century topographical list of Thutmose III.According to biblical tradition, the Israelites under Joshua conquered Aphek from the Canaanites.With the Philistines advancing toward the city, the Israelites fled towards the hills of Samaria, and Aphek became the northernmost locality in Philistia.