A light emitting device comprising: a substrate; a light emitting structure disposed over the substrate, comprising a first-conductivity-type semiconductor layer, an active layer, and a second-conductivity-type semiconductor layer, wherein the first-conductivity-type semiconductor layer, the active layer, and the second-conductivity-type semiconductor layer are disposed to be adjacent to one another in a same direction, the active layer comprises well and barrier layers alternately stacked at least one time, and the well layer has a smaller energy bandgap than the barrier layer; a mask layer disposed in the first-conductivity-type semiconductor layer, wherein the mask layer suppresses migration of crystal defects formed at the interface between the substrate and the light emitting structure toward the top of the light emitting device; a first electrode disposed on the first-conductivity-type semiconductor layer; and a second electrode disposed on the second-conductivity-type semiconductor layer, wherein the first-conductivity-type semiconductor layer comprises a first portion and a second portion and the mask layer comprises a masking region and a window region distinguished from the masking region, wherein the mask layer is disposed on the first portion of the first-conductivity-type semiconductor layer and the masking region of the mask layer is disposed between the first portion and the second portion of the first-conductivity-type semiconductor layer, wherein the second portion of the first-conductivity-type semiconductor layer is formed with at least one recess portion, and characterized in that the light emitting structure is mesa-etched from the second-conductivity-type semiconductor layer to the first portion of the first-conductivity-type semiconductor layer, with the first electrode being disposed on the first portion of the first-conductivity-type semiconductor layer exposed by the mesa-etching. a substrate; a light emitting structure disposed over the substrate, comprising a first-conductivity-type semiconductor layer, an active layer, and a second-conductivity-type semiconductor layer, wherein the first-conductivity-type semiconductor layer, the active layer, and the second-conductivity-type semiconductor layer are disposed to be adjacent to one another in a same direction, the active layer comprises well and barrier layers alternately stacked at least one time, and the well layer has a smaller energy bandgap than the barrier layer; a mask layer disposed in the first-conductivity-type semiconductor layer, wherein the mask layer suppresses migration of crystal defects formed at the interface between the substrate and the light emitting structure toward the top of the light emitting device; a first electrode disposed on the first-conductivity-type semiconductor layer; and a second electrode disposed on the second-conductivity-type semiconductor layer, wherein the first-conductivity-type semiconductor layer comprises a first portion and a second portion and the mask layer comprises a masking region and a window region distinguished from the masking region, wherein the mask layer is disposed on the first portion of the first-conductivity-type semiconductor layer and the masking region of the mask layer is disposed between the first portion and the second portion of the first-conductivity-type semiconductor layer, wherein the second portion of the first-conductivity-type semiconductor layer is formed with at least one recess portion, and characterized in that the light emitting structure is mesa-etched from the second-conductivity-type semiconductor layer to the first portion of the first-conductivity-type semiconductor layer, with the first electrode being disposed on the first portion of the first-conductivity-type semiconductor layer exposed by the mesa-etching.