I declared war against an empire which had a vassal. I had captured one of the vassals cities and it was occupied. I think the vassal state broke away from its liege during the war and I was no longer able to attack them as I guess we were no longer at war, but the captured city was still occupied. It stayed occupied even after the end of the war. 


I hope that makes sense!