Other tribes in the area naturally become concerned at this point, just as Jericho was at the start. The Gibeonites trick the Israelites into an alliance, and end up as “slaves” or aliens working at menial tasks.
Read Joshua 9:3-6
Other tribes, rather than attacking Israel, now attack Gibeon, thus testing not only the strength but also the trustworthiness of their enemy.
Joshua’s army sets out under cover of night and hides in the hills and forests round Gibeon—it’s interesting that we think in terms of nations fighting nations, whereas the story is more a record of one tribal city attacking another—more like early America than middle-ages Europe.
The Ammonites would probably have camped near water, and the Israelite attack, at night, rushing down from the hillsides, was a big success. Still, it wouldn’t help the invasion much unless the fleeing forces could be killed before they regrouped.
Read Josh 10:12-14. Some translations say the sun hastened not to go down, but more commonly they just claim the sun and moon both stood still.
Interestingly, I’d always interpreted this story as God granting Joshua an incredibly long day in which to fight his foes. As the authors of Battles of the Bible point out, that would be singularly illogical in military terms, and it’s far more likely God granted them an over-long night by making the morning mists obscure the sun. After all, Joshua’s army was good at and armed for hand-to-hand fighting in trees, while the enemy were armed for and accustomed to full-scale battle formations. History and geography reveal that thick mists do arise in the Ajalon valley, but, like the Jordan running dry, they can’t usually be called on to happen just when we need them.