A semiconductor device comprising: a semiconductor substrate; an n-type semiconductor layer (10; 12) made of silicon carbide formed on a front surface of the semiconductor substrate; and a p-type junction termination portion formed on an upper surface side of the semiconductor layer (10; 12) so as to surround an active region portion, wherein the junction termination portion includes: a plurality of p-type first semiconductor regions having a first impurity concentration; a plurality of p-type second semiconductor regions having a second impurity concentration lower than the first impurity concentration; and a plurality of p-type third semiconductor regions having a third impurity concentration lower than the second impurity concentration, the junction termination portion comprising a first p-type region, consisting of alternately arranged second semiconductor regions and first semiconductor regions, and a second p-type region, contiguous to the first region and closer to an end portion side of the semiconductor substrate than the first region, the second region consisting of alternately arranged third semiconductor regions and first semiconductor regions, the first region having a first concentration gradient and the second region having a second concentration gradient larger than the first concentration gradient, the first and the second concentration gradients (S1, S2) representing decreasing concentrations toward the end portion side of the semiconductor substrate, wherein the first impurity concentration is equal to the sum of the second and the third impurity concentrations. a semiconductor substrate; an n-type semiconductor layer (10; 12) made of silicon carbide formed on a front surface of the semiconductor substrate; and a p-type junction termination portion formed on an upper surface side of the semiconductor layer (10; 12) so as to surround an active region portion, wherein the junction termination portion includes: a plurality of p-type first semiconductor regions having a first impurity concentration; a plurality of p-type second semiconductor regions having a second impurity concentration lower than the first impurity concentration; and a plurality of p-type third semiconductor regions having a third impurity concentration lower than the second impurity concentration, the junction termination portion comprising a first p-type region, consisting of alternately arranged second semiconductor regions and first semiconductor regions, and a second p-type region, contiguous to the first region and closer to an end portion side of the semiconductor substrate than the first region, the second region consisting of alternately arranged third semiconductor regions and first semiconductor regions, the first region having a first concentration gradient and the second region having a second concentration gradient larger than the first concentration gradient, the first and the second concentration gradients (S1, S2) representing decreasing concentrations toward the end portion side of the semiconductor substrate, wherein the first impurity concentration is equal to the sum of the second and the third impurity concentrations. a plurality of p-type first semiconductor regions having a first impurity concentration; a plurality of p-type second semiconductor regions having a second impurity concentration lower than the first impurity concentration; and a plurality of p-type third semiconductor regions having a third impurity concentration lower than the second impurity concentration, the junction termination portion comprising a first p-type region, consisting of alternately arranged second semiconductor regions and first semiconductor regions, and a second p-type region, contiguous to the first region and closer to an end portion side of the semiconductor substrate than the first region, the second region consisting of alternately arranged third semiconductor regions and first semiconductor regions, the first region having a first concentration gradient and the second region having a second concentration gradient larger than the first concentration gradient, the first and the second concentration gradients (S1, S2) representing decreasing concentrations toward the end portion side of the semiconductor substrate, wherein the first impurity concentration is equal to the sum of the second and the third impurity concentrations.