A semiconductor device includes a drift region, which includes a first
alternating conductivity type layer, and a peripheral region, which
includes a second alternating conductivity type layer and a third
alternating conductivity type layer in the surface portion of the
peripheral region. The first layer includes first n-type regions and first
p-type regions arranged alternately at a first pitch. The second layer is
continuous with the first layer and includes second n-type regions and
second p-type regions arranged alternately at the first pitch. The
impurity concentration in the second layer is almost the same as the
impurity concentration in the first layer. The third layer includes third
n-type regions and third p-type regions arranged alternately at a second
pitch. The third layer can be doped more lightly than the first and second
alternating conductivity type layers. The second pitch can be the same as
the first pitch or smaller.