A highly reliable semiconductor device that controls both defects and
impurity diffusion and a method for manufacturing such a semiconductor
device. An N.sup.+ embedment layer and an N-type epitaxial layer are
formed on a main surface region of a P-type silicon substrate. An STI
trench is formed in the N-type epitaxial layer. A thermal oxidation film
is formed on the inner surface of the STI trench. The STI trench is
filled with an HDP-NSG film. A deep trench is formed in the STI trench
with a depth reaching the silicon substrate. A further thermal oxidation
film is formed on the inner surface of the deep trench. The thermal
oxidation film of the deep trench is thinner than that of the STI trench.
A silicon oxidation film is also formed in the deep trench and filled
with a polysilicon film.