A distributed feedback semiconductor laser, comprising: a semiconductor stacked body including a first layer, an active layer, and a second layer, the active layer being provided on the first layer and being configured to emit laser light by an intersubband optical transition, the second layer being provided on the active layer; and a first electrode, the semiconductor stacked body having a first surface including a flat portion and a plurality of trench portions, the flat portion including a front surface of the second layer, the trench portions reaching the first layer from the front surface, the flat portion including a first region and a plurality of second regions, the first region extending along a central axis of the active layer, the second regions extending in a lateral direction to be orthogonal to the central axis, respective pairs of the trench portions being formed on opposing sides of the first region in the lateral direction and each trench portion having a predetermined width in the lateral direction, the trench portions and the second regions being arranged alternately along the central axis thus forming a diffraction grating having a prescribed pitch along the central axis, the first electrode being provided in the first region, and a ridge waveguide being provided on a cross-section which is perpendicular to the central axis and passes the trench portions, the ridge waveguide being confined in the lateral direction by the respective pairs of the trench portions and the ridge waveguide including a part of the second layer which is under the first region, a part of the active layer which is under the first region, and a part of the first layer which is under the first region of the semiconductor stacked body, no ridge waveguide being provided on a cross-section which is perpendicular to the central axis and passes the second region, so that heat that is generated in a region of the active layer which is sandwiched by the second regions is dissipated downward and in the lateral direction. a semiconductor stacked body including a first layer, an active layer, and a second layer, the active layer being provided on the first layer and being configured to emit laser light by an intersubband optical transition, the second layer being provided on the active layer; and a first electrode, the semiconductor stacked body having a first surface including a flat portion and a plurality of trench portions, the flat portion including a front surface of the second layer, the trench portions reaching the first layer from the front surface, the flat portion including a first region and a plurality of second regions, the first region extending along a central axis of the active layer, the second regions extending in a lateral direction to be orthogonal to the central axis, respective pairs of the trench portions being formed on opposing sides of the first region in the lateral direction and each trench portion having a predetermined width in the lateral direction, the trench portions and the second regions being arranged alternately along the central axis thus forming a diffraction grating having a prescribed pitch along the central axis, the first electrode being provided in the first region, and a ridge waveguide being provided on a cross-section which is perpendicular to the central axis and passes the trench portions, the ridge waveguide being confined in the lateral direction by the respective pairs of the trench portions and the ridge waveguide including a part of the second layer which is under the first region, a part of the active layer which is under the first region, and a part of the first layer which is under the first region of the semiconductor stacked body, no ridge waveguide being provided on a cross-section which is perpendicular to the central axis and passes the second region, so that heat that is generated in a region of the active layer which is sandwiched by the second regions is dissipated downward and in the lateral direction.