Joshua 2:2

And it was told the king of Jericho, saying, Behold, there came men in hither to night of the children of Israel to search out the country.

Joshua sent the spies in secret so that hostile resistance would not be built up before Israel was able to go up and take possession of the land. The king of Jericho was then told that men from the children of Israel had come in by night to search out the country. That report laid open that they were there and endangered the secrecy of their mission.

The verse stands in the account of Rahab, a Canaanite who turned away from idolatry to worship the true God and cast in her lot with His chosen people. Her case shows that those of other nations could respond to God and become part of Israel. The way the mission was kept hidden illustrates the caution needed when premature publicity would obstruct a work.