Joshua 10:5

Therefore the five kings of the Amorites, the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, the king of Eglon, gathered themselves together, and went up, they and all their hosts, and encamped before Gibeon, and made war against it.

Joshua 10:5 belongs to the account of Israel's treaty with the Gibeonites. That treaty was sought by the Gibeonites to preserve their own lives. To obtain it they resorted to a stratagem, presenting themselves as having come from a distant country when in reality they were Israel's neighbors.