Gibeon was a chief city of the Hivites. The expressed will of God for the people of Israel was for them to extinguish the people of the land of Canaan, including the Hivites. (Deut. 7:1) Deuteronomy 7:2 says: "thou shalt make no covenant with them." Nonetheless, the men of Gibeon disguised themselves and deceived the Israelites into forming a league with them, contrary to the will of God. Joshua and the princes of Israel "asked not counsel at the mouth of the Lord." (Josh. 9:14). If they had sought counsel, the Lord would have instructed them not to trust the deceivers, and they would not have made that covenant. Once, however, the league with Gibeon was formed, it was God's will for Israel to keep her promise. (Psalm 15). He honored the choice of his people, even when they had obviously made the wrong choice. How much more will he honor the choices of his people when they are making their decisions based on the principles of Scripture!
God did not direct Joshua to make the league with Gibeon. He had been left out of the decision making process. Nonetheless he blessed Israel and even used the league with Gibeon for Israel's good. (Rom. 8:28). Five kings of the land came out against Gibeon. Honoring the newly made covenant, the Israelites went to war in Gibeon's defense, and "the Lord fought for Israel." (Josh. 10:14). God so blessed them in the battle that he cast down great stones from heaven upon their enemies. (Josh. 10:11). In this battle the sun and moon stood still. The Scripture records that "there was no day like that before it or after it, that the Lord hearkened unto the voice of a man." (Josh 10:14).