Eglon was an Amorite (see Amorites) city in "the land of Canaan" (see the Fact Finder question below) that was destroyed by the Israelites after the king of Eglon joined in a war against the Gibeonites who had managed to become allied with Israel (see Gibeon). That battle itself has become secondary to a famous miraculous event that occurred in the sky above the battle - "the sun stood still, and the moon stayed, until the people had avenged themselves upon their enemies." Eglon was later destroyed by the Israelites, charred evidence of which has been discovered by archaeologists.
"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"
The battle occurred when much of the Israelites' physical promised land was yet to be taken. Even Jerusalem was still in non-Israelite hands, as evidenced by that the Amorite king of Jerusalem was one of the five kings who fought against the Israelites.
"Now it came to pass, when Adonizedek king of Jerusalem had heard how Joshua had taken Ai, and had utterly destroyed it; as he had done to Jericho and her king, so he had done to Ai and her king; and how the inhabitants of Gibeon had made peace with Israel, and were among them; That they feared greatly, because Gibeon was a great city, as one of the royal cities, and because it was greater than Ai, and all the men thereof were mighty. Wherefore Adonizedek king of Jerusalem sent unto Hoham king of Hebron, and unto Piram king of Jarmuth, and unto Japhia king of Lachish, and unto Debir king of Eglon, saying, Come up unto me, and help me, that we may smite Gibeon: for it hath made peace with Joshua and with the children of Israel."
"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:1-5 KJV)
It's one of the most curious miracles of Bible History, "the sun stood still in the midst of heaven, and hasted not to go down about a whole day."
"Then spake Joshua to The Lord [see YHVH, Adonai, Jehovah, LORD] in the day when The Lord delivered up the Amorites before the children of Israel, and he said in the sight of Israel, Sun, stand thou still upon Gibeon; and thou, Moon, in the valley of Ajalon."
"And the sun stood still, and the moon stayed, until the people had avenged themselves upon their enemies. Is not this written in the book of Jasher? So the sun stood still in the midst of heaven, and hasted not to go down about a whole day. And there was no day like that before it or after it, that The Lord hearkened unto the voice of a man: for The Lord fought for Israel."
"And Joshua returned, and all Israel with him, unto the camp to Gilgal." (Joshua 10:12-15 KJV)
After the Israelites defeated the enemy forces on the battlefield, they captured and executed the five kings of the Amorites who had started the war.
"But these five kings fled, and hid themselves in a cave at Makkedah. And it was told Joshua, saying, The five kings are found hid in a cave at Makkedah." (Joshua 10:16-17 KJV)
"Then said Joshua, Open the mouth of the cave, and bring out those five kings unto me out of the cave. And they did so, and brought forth those five kings unto him out of the cave, the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon. And it came to pass, when they brought out those kings unto Joshua, that Joshua called for all the men of Israel, and said unto the captains of the men of war which went with him, Come near, put your feet upon the necks of these kings. And they came near, and put their feet upon the necks of them."
"And Joshua said unto them, Fear not, nor be dismayed, be strong and of good courage: for thus shall The Lord do to all your enemies against whom ye fight. And afterward Joshua smote them, and slew them, and hanged them on five trees: and they were hanging upon the trees until the evening."
"And it came to pass at the time of the going down of the sun, that Joshua commanded, and they took them down off the trees [see Gallows], and cast them into the cave wherein they had been hid, and laid great stones in the cave's mouth, which remain until this very day." (Joshua 10:22-27 KJV)
The rout then continued to finality.
"And from Lachish Joshua passed unto Eglon, and all Israel with him; and they encamped against it, and fought against it: And they took it on that day, and smote it with the edge of the sword, and all the souls that were therein he utterly destroyed that day, according to all that he had done to Lachish."
"And Joshua went up from Eglon, and all Israel with him, unto Hebron; and they fought against it: And they took it, and smote it with the edge of the sword, and the king thereof, and all the cities thereof, and all the souls [see Where Is Your Soul?] that were therein; he left none remaining, according to all that he had done to Eglon; but destroyed it utterly, and all the souls that were therein." (Joshua 10:34-37 KJV)
Fact Finder: Why was the Israelites' promised land known as "the land of Canaan"?
See The Land Of Canaan