A semiconductor device comprising: a semiconductor substrate of a first conductivity type; a semiconductor element that is provided on the semiconductor substrate and includes an active region in which a main current flows and a termination structure region which surrounds the active region; a protective diode that is provided above the termination structure region, with an insulating film interposed therebetween; one or more diffusion layers of a second conductivity type that are selectively provided in a surface layer of a surface of the semiconductor substrate, which comes into contact with the insulating film, so as to surround the active region in the termination structure region; and a surface protective film (14, 15) that covers the termination structure region, wherein the protective diode includes a plurality of diodes which are formed by alternately arranging first-conductivity-type semiconductor layers and second-conductivity-type semiconductor layers (19, 20) so as to be adjacent to each other in a direction from the active region to the outside, one end of the protective diode is electrically connected to a high-potential electrode which is provided on an outer circumferential side of the semiconductor element and is disposed outside an outer circumferential end of the outermost diffusion layer, the other end of the protective diode is electrically connected to a gate wire of the semiconductor element which is provided on the active region side, the termination structure region is divided into a first section in which the protective diode is arranged, a second section which has a smaller width than the first section, and a third section which has a width that increases from the second section to the first section and connects the first section and the second section, the one or more diffusion layers have a ring shape in a plan view which includes a first portion that is arranged in the first section and faces the protective diode in a depth direction, a second portion that is arranged in the second section and is disposed closer to the outer circumference of the semiconductor substrate than the first portion, and a third portion that is arranged in the third section, and a surface area of the second portion is greater than a surface area of the first portion, wherein a width of the portion of the one or more diffusion layers which faces the protective diode is greater than a width of the remaining portion of the one or more diffusion layers. a semiconductor substrate of a first conductivity type; a semiconductor element that is provided on the semiconductor substrate and includes an active region in which a main current flows and a termination structure region which surrounds the active region; a protective diode that is provided above the termination structure region, with an insulating film interposed therebetween; one or more diffusion layers of a second conductivity type that are selectively provided in a surface layer of a surface of the semiconductor substrate, which comes into contact with the insulating film, so as to surround the active region in the termination structure region; and a surface protective film (14, 15) that covers the termination structure region, wherein the protective diode includes a plurality of diodes which are formed by alternately arranging first-conductivity-type semiconductor layers and second-conductivity-type semiconductor layers (19, 20) so as to be adjacent to each other in a direction from the active region to the outside, one end of the protective diode is electrically connected to a high-potential electrode which is provided on an outer circumferential side of the semiconductor element and is disposed outside an outer circumferential end of the outermost diffusion layer, the other end of the protective diode is electrically connected to a gate wire of the semiconductor element which is provided on the active region side, the termination structure region is divided into a first section in which the protective diode is arranged, a second section which has a smaller width than the first section, and a third section which has a width that increases from the second section to the first section and connects the first section and the second section, the one or more diffusion layers have a ring shape in a plan view which includes a first portion that is arranged in the first section and faces the protective diode in a depth direction, a second portion that is arranged in the second section and is disposed closer to the outer circumference of the semiconductor substrate than the first portion, and a third portion that is arranged in the third section, and a surface area of the second portion is greater than a surface area of the first portion, wherein a width of the portion of the one or more diffusion layers which faces the protective diode is greater than a width of the remaining portion of the one or more diffusion layers.