Jehoshaphat, when faced with a major onslaught from his enemies, said,
“We are powerless against this mighty army that is about to attack us. We do not know what to do, but we are looking to you for help.”
The Spirit of the LORD came upon one of the men standing there. He said, “Listen, all you people of Judah and Jerusalem! Listen, King Jehoshaphat! This is what the Lord says: Do not be afraid! Don’t be discouraged by this mighty army, for the battle is not yours, but God’s. Tomorrow, march out against them. But you will not even need to fight. Take your positions; then stand still and watch the Lord’s victory. He is with you, O people of Judah and Jerusalem. Do not be afraid or discouraged. Go out against them tomorrow, for the Lord is with you!”
Then King Jehoshaphat bowed low with his face to the ground. And all the people of Judah and Jerusalem did the same, worshiping the Lord. Then the Levites from the clans of Kohath and Korah stood to praise the Lord, the God of Israel, with a very loud shout.
After consulting the people, the king appointed singers to walk ahead of the army, singing to the Lord and praising him for his holy splendor. This is what they sang:
“Give thanks to the Lord;
his faithful love endures forever!”
At the very moment they began to sing and give praise, the Lord caused the armies of Ammon, Moab, and Mount Seir to start fighting among themselves. The armies of Moab and Ammon turned against their allies from Mount Seir and killed every one of them. After they had destroyed the army of Seir, they began attacking each other. So when the army of Judah arrived at the lookout point in the wilderness, all they saw were dead bodies lying on the ground as far as they could see. Not a single one of the enemy had escaped.
Extracts from 2 Chronicles 20 (NLT) - my emphases.