Optoelectronic component comprising a semiconductor body, which has an epitaxial layer sequence comprising an active layer suitable for generating radiation, and a carrier substrate composed of a semiconductor material, which is connected to the semiconductor body by means of a solder layer, wherein - the carrier substrate has a first plated-through hole and a second plated-through hole, which are led in each case from a first main surface of the carrier substrate facing the semiconductor body to a second main surface of the carrier substrate facing away from the semiconductor body, - the epitaxial layer sequence has a p-doped semiconductor region and an n-doped semiconductor region, wherein the first plated-through hole is electrically conductively connected to the p-doped semiconductor region by means of a first partial region of the solder layer and the second plated-through hole is electrically conductively connected to the n-doped semiconductor region by means of a second partial region of the solder layer, characterized in that - the carrier substrate has a surface doping zone extending along the first main surface, - the surface doping zone has a p-conducting region containing a p-type dopant, - the surface doping zone has an n-conducting region adjoining the p-conducting region and containing both an n-type dopant and a p-type dopant, such that a pn junction is formed between the p-conducting region and the n-conducting region, - the n-conducting region is electrically connected to the first partial region of the solder layer and the p-conducting region is electrically connected to the second partial region of the solder layer, such that the pn junction in the surface doping zone forms a protective diode for the semiconductor body, wherein the n-conducting region is arranged in a ring-shaped manner around the first plated-through hole. - the carrier substrate has a first plated-through hole and a second plated-through hole, which are led in each case from a first main surface of the carrier substrate facing the semiconductor body to a second main surface of the carrier substrate facing away from the semiconductor body, - the epitaxial layer sequence has a p-doped semiconductor region and an n-doped semiconductor region, wherein the first plated-through hole is electrically conductively connected to the p-doped semiconductor region by means of a first partial region of the solder layer and the second plated-through hole is electrically conductively connected to the n-doped semiconductor region by means of a second partial region of the solder layer, - the carrier substrate has a surface doping zone extending along the first main surface, - the surface doping zone has a p-conducting region containing a p-type dopant, - the surface doping zone has an n-conducting region adjoining the p-conducting region and containing both an n-type dopant and a p-type dopant, such that a pn junction is formed between the p-conducting region and the n-conducting region, - the n-conducting region is electrically connected to the first partial region of the solder layer and the p-conducting region is electrically connected to the second partial region of the solder layer, such that the pn junction in the surface doping zone forms a protective diode for the semiconductor body, wherein the n-conducting region is arranged in a ring-shaped manner around the first plated-through hole.