In 2 Melachim 3:24-25 it says
They entered the Israelite camp, and the Israelites arose and attacked the Moabites, who fled before them. They advanced, constantly attacking the Moabites, and they destroyed the towns. Every man threw a stone into each fertile field, so that it was covered over; and they stopped up every spring and felled every fruit tree. Only the walls of Kir-hareseth were left, and then the slingers surrounded it and attacked it.
However this violates Devarim 20:19
When in your war against a city you have to besiege it a long time in order to capture it, you must not destroy its trees, wielding the ax against them. You may eat of them, but you must not cut them down. Are trees of the field human to withdraw before you into the besieged city?
Presumably the reason they did this is because the Navi told them to in pasuk 19
You shall conquer every fortified town and every splendid city; you shall fell every good tree and stop up all wells of water; and every fertile field you shall ruin with stones.
I would like to understand why this was commanded. Presumably they could have won the battle without destroying the trees.