Thanks to lost paperwork, diplomatic technicalities, or just plain forgetting they had declared war in the first place, many countries remained in a state of war long after the actual fighting had stopped.
After two Punic wars, Rome decided they needed one more pass at Carthage. So in 149 BC, after rousing speeches in the Senate with Cato the Censor declaring unequivocally, “Carthage must be destroyed,” the Roman army set out once again to try to demolish the North African city state. While Rome was eventually victorious, the Carthaginians never actually surrendered, and the citizens fought the invaders long after they had breached the city walls.
In 1985, the mayors of modern Rome and Carthage decided to sign a ceremonial peace treaty as a sign of friendship, signing it among the ruins of the city the Romans had razed to the ground.