A tense nighttime manhunt begins, driven entirely by a false assumption. The local men chase after the spies, but at this stage, the pursuit exists only in their minds, as the Israelites are still safely hidden on the roof. The search party heads toward the Jordan River, traveling as far as the water crossing points [רד״ק, רש״י, מצודת ציון]. They assume the spies are making their way back to the Israelite camp in the plains of Moab, prompting them to hurry to the places where the river can be crossed [רש״י, ביאור שטיינזלץ]. Hoping to outpace men fleeing on foot, the pursuers rush to these locations on horseback [ביאור שטיינזלץ].
As the pursuers leave, a closure occurs behind them, sparking a fascinating debate among commentators regarding what exactly is shut, who shuts it, and for what purpose. The primary approach among commentators is that this refers to the main city gate. The city guards secure the gate immediately after the search party departs, ensuring that if the spies are still hiding inside the city, they will be trapped [מצודת דוד, ביאור שטיינזלץ]. This sudden lockdown may have been prompted by Rahab herself, who scolded the guards for their negligence in leaving the city gate open during such a tense night [אברבנאל].
Another perspective suggests that the closed barrier is actually the door to Rahab's house. Within this view, opinions differ on who secures the lock. Some suggest that the spies themselves, or members of Rahab's household, lock the door from the inside to keep anyone else from entering and discovering the hiding place [רד״ק, אברבנאל]. They are careful not to shut it the moment the men leave. Instead, they wait until the pursuers are far enough away so that the sound of the door closing does not reveal their presence [רד״ק].
Conversely, a surprising and original approach proposes that the pursuers themselves lock the door from the outside [מלבי״ם, אלשיך]. Suspecting that Rahab might be trying to trick them and buy time to smuggle the spies out, the men lock the house immediately upon leaving to hunt them down. Their plan is simple. If they fail to find the spies outside, they will return to conduct a thorough search of the locked house. This interpretation sheds new light on later events, explaining exactly why Rahab is forced to lower the spies down by a rope through the window. With the front door locked from the outside, they have absolutely no other way to escape [אלשיך].