Sounds like this may be the dreaded
cmos 'latch-up'. Happens when a voltage spike coming in on any of the leads exceeds VCC or GND voltages, jamming current into the chip's die. A good sign of this is the chip seems dead, it may get warm or the power supply voltage is now too low. Capacitive coupling from long wires, inductive loads and ground bounce are prime causes.
For inductive loads like relay coils, a diode only clamps the voltage, it doesn't limit how fast the voltage changes. On some projects I have had to put a series 47 ohm resistor/.1 uF cap network across the coil terminals to suppress the kick back spike's slope so it wouldn't couple so strongly into the other input wires, triggering a latch-up.
A way I've used to desensitize the input input pins is to put 10k resistors in series with the pins, as close to the micro-controller as possible. This limits how much current a spike can dump into the chip, thus preventing the latch-up.