Also, it is worth mentioning that you can auto ceasefire if you share a border with an enemy, and they are forced to retreat to a castle. This once happened to me when I was playing as France, and was at war with the Aragonese. They started it by invaded Toulouse. Aragon only had one province (Aragon), which Spain invaded some time later. The battle must have gone the way of the Spanish, and the King of Aragon was forced to seek shelter in his castle. The next turn, the siege was still underway, but France and Aragon were no longer at war.

I suppose this is because the invaders (in this case the Spanish) actually own the province when the defenders are under siege. However, from reading the posts in these forums I see that a similar trick has been used by Holy Roman Empire players in GA mode. One of the GA goals is the establishment of the Holy Roman Empire, and this normally involves war with the Papal States. However, to avoid excommunication (and a very angry pope returning with many troops at a later date) you can apparently invade the Papal States, push the pope into the castle, and then withdraw. Then, you get an auto-ceasefire, and the pope lives to fight another day.

I think this only works if you haven't got a ship near-by. However, you still have land borders. I don't know the details I am afraid, as I have never played as the HRE.