A protective circuit consisting of a resistor and MOSFET in a diode form and a switching element are connected to a bonding pad in order to prevent destruction of an internal circuit consisting of one or more MOSFETs. The switching element may consist of a parasitic MOSFET whose source and drain regions are formed by well regions. One of the well regions is connected to a semiconductor region as a guard ring.