A semiconductor device includes an active layer, an n-side contact layer,
and a p-side contact layer. The nitride semiconductor device includes at
least a first n-side layer, a second n-side layer, a third n-side layer
and a fourth n-side layer formed in this order from the n-side contact
layer between the n-side contact layer and the active layer, while at
least the second n-side layer and the fourth n-side layer each contain an
n-type impurity, and the concentration of the n-type impurity in at least
the second n-side layer and the fourth n-side layer is higher than the
concentration of the n-type impurity in the first n-side layer and the
third n-side layer.