To avoid excommunication, you have to withdraw from the territory and send a diplomat to arrange a ceasefire - otherwise you are still at war. If you do not get that ceasefire you will get excommunicated.
But here is a clever ploy, declare war on one faction and then on another immediately, followed by a ceasefire on the first faction. The computer can only keep track of one excommunication at a time and so does not recognise the second war and you can obliterate the faction at your leisure. I would not recommend fighting the Pope. His faction always reappears with massive armies and you end up having to garrison central Italy with a large army just to keep him under control. Why not use the Pope instead. Strip a province of defences, wait for your neighbour to invade and then crush him when he is excommunicated.
Bookmarks