A semiconductor device which has a substrate formed as a rigid body, includes stress relaxation layers formed by filling in concave portions defined in a first main surface of the substrate, and a device forming layer which covers part of the first main surface and is formed in the substrate. The substrate is made up of a material larger than the stress relaxation layers and the device forming layer in thermal expansion coefficient. Side faces of the device forming layer are electrically connected to their corresponding upper surfaces of the stress relaxation layers in an electrically non-conducting state via insulative stress transfer layers formed on the upper surfaces.