A semiconductor module comprising: a rectangular base plate; a substrate which is placed on the base plate and on which a circuit that includes a driving terminal to drive a semiconductor chip and the semiconductor chip is formed; a rectangular parallelepiped case made of resin that is attached to the base plate and houses the substrate within; and a plurality of external terminals (3a, 3b, 3c) lower ends of which are fixed to the substrate with upper ends thereof being exposed on a top face of the case, characterized in that the case includes: a first case opening portion that is formed by cutting off a front face of the case along a longitudinal direction thereof from an upper edge thereof to a first case opening lower edge portion; a second case opening portion that is formed by cutting off a rear face of the case along the longitudinal direction thereof from the upper edge thereof to a second case opening lower edge portion; an external terminal holding portion that is provided in the top face of the case between the first case opening portion and the second case opening portion and holds the plurality of external terminals along the longitudinal direction with the upper ends thereof being exposed; a first partition wall formed in vertical direction inside the case; a central room and a stress absorption room divided by the first partition wall; a second partition wall formed in vertical direction inside the case; a driving terminal room divided from the central room by the second partition wall; and a sealing material (10,11) having been injected from the first case opening portion or the second case opening portion onto a top face of the substrate; wherein the substrate is disposed in the central room, the stress absorption room includes a space portion not less than an amount of a volume expansion caused by a thermal stress of the sealing material, and a small hole (90, 91) that is provided at an upper part and communicably connected to outside, the driving terminal is routed inside the driving terminal room, the driving terminal room further includes a driving terminal opening to cause the driving terminal to be exposed to outside, the first case opening portion, the second case opening portion and the external terminal holding portion are included in the central room of the case, and the first case opening portion and the second case opening portion are set to have a length equal to a distance between the first and the second partition wall (15a, 15b), and are set to have a height equal to a distance from the top face of the case to the case opening lower edge portion. a rectangular base plate; a substrate which is placed on the base plate and on which a circuit that includes a driving terminal to drive a semiconductor chip and the semiconductor chip is formed; a rectangular parallelepiped case made of resin that is attached to the base plate and houses the substrate within; and a plurality of external terminals (3a, 3b, 3c) lower ends of which are fixed to the substrate with upper ends thereof being exposed on a top face of the case, a first case opening portion that is formed by cutting off a front face of the case along a longitudinal direction thereof from an upper edge thereof to a first case opening lower edge portion; a second case opening portion that is formed by cutting off a rear face of the case along the longitudinal direction thereof from the upper edge thereof to a second case opening lower edge portion; an external terminal holding portion that is provided in the top face of the case between the first case opening portion and the second case opening portion and holds the plurality of external terminals along the longitudinal direction with the upper ends thereof being exposed; a first partition wall formed in vertical direction inside the case; a central room and a stress absorption room divided by the first partition wall; a second partition wall formed in vertical direction inside the case; a driving terminal room divided from the central room by the second partition wall; and a sealing material (10,11) having been injected from the first case opening portion or the second case opening portion onto a top face of the substrate; wherein the substrate is disposed in the central room, the stress absorption room includes a space portion not less than an amount of a volume expansion caused by a thermal stress of the sealing material, and a small hole (90, 91) that is provided at an upper part and communicably connected to outside, the driving terminal is routed inside the driving terminal room, the driving terminal room further includes a driving terminal opening to cause the driving terminal to be exposed to outside, the first case opening portion, the second case opening portion and the external terminal holding portion are included in the central room of the case, and the first case opening portion and the second case opening portion are set to have a length equal to a distance between the first and the second partition wall (15a, 15b), and are set to have a height equal to a distance from the top face of the case to the case opening lower edge portion.