A semiconductor device comprising: a substrate (1, 1a, 2a, 2b, 3a, 4a, 5, 6, 8, 10, 11, T1, T2) having a first side and a second side; an IGBT (100i, 104i , 105i); and diodes (100d, 104d, 105d). The substrate (1, 1a, 2a, 2b, 3a, 4a, 5, 6, 8, 10, 11, T1, T2) comprises: a first layer (1); a second layer ( 2a); the N region (3a) on the first side on the second layer (2a); the N region and the P region (5, 6) on the second side, located on the second side of the first layer (1); the first The first electrode (8) in the trench (T1) serves as a gate; the second electrode (10) is located on the N region (3a) on the first side and in the second trench (T2) and serves as an emitter and an anode; and a third electrode (11), located on the N and P regions (5, 6) on the second side, serving as a collector and a cathode. The first trench (T1) passes through the N region (3a) on the first side and the second layer (2a), and reaches the first layer (1). The second trench (T2) passes through the N region (3a) on the first side and reaches the second layer (2a).