Exodus 13:17-18

17 When Pharaoh let the people go, God did not lead them by way of the land of the Philistines, although that was nearer; for God thought, "If the people face war, they may change their minds and return to Egypt."
18 So God led the people by the roundabout way of the wilderness toward the Red Sea. The Israelites went up out of the land of Egypt prepared for battle.

Footnotes 1

New Revised Standard Version Bible, copyright 1989, Division of Christian Education of the National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved.