211 with a smaller impurity implanting quantity fig3 is a cross sectional view illustrating the structure of the semiconductor device in embodiment 3 in the present embodiment the anode layer 106 shown in fig1 is substituted for by the anode layer 301 shown in fig3 on the outer side the second trench 132 an anode layer 301 is formed on the bottom surface and side surfaces of the second trenches 132 the anode layer 301 is a p u2212 type layer just as with the anode layer 106 and it corresponds to an example of the sixth semiconductor layer an embedded semiconductor layer 302 fills the second trench 132 for example the embedded semiconductor layer 302 is a polysilicon layer and it corresponds to an example of the embedded layer in the present embodiment this embedded layer is formed of a semiconductor however it may also be made of a conductor an example of such a conductor is w tungsten etc for example the anode layer 301 and embedded semiconductor layer 302 may be formed as follows after formation of the second trench 132 impurity ions are implanted in the bottom surface and side surface of the second trench 132 and after ion implanting a semiconductor material is then deposited to fill the interior of the second trench 132 in the present embodiment the second contact layer 109 shown in fig1 is substituted for by the second contact layer 303 shown in fig2 here the second contact layer 303 is a p type layer and it is formed adjacent to the second trench 132 on the first principal surface s 1 of the first base layer 101 and overlying the anode layer 310 embodiment 1 and embodiment 3 are compared with each other as follows.