“So the king of Jericho sent to Rahab.” Apparently, the king did not come himself, but sent representatives. This occurred after dark (cp. Joshua 2:5).
“all the land.” That the king of Jericho knew the mission of Israel, to conquer the Promised Land, shows that news of Israel, including who they were and what they wanted had been spread around.