The semiconductor device includes an optical absorption layer which consists of a compound of gallium indium arsenic phosphide. Also provided is a p-type semiconductor layer which consists of a p-type AlGaInAs layer and it is adjacent to the absorption layer. Pref. the difference in the valency band offset between the absorption layer and the p-type layer is set to be below 0.05 EV. The optical absorption layer may contain an absorption limit wavelength of 1.65 to 1.55 microns, while the absorption limit wavelength of the p-type semiconductor layer is shorter, i.e. 1.55 to 1.30 microns, wavelengths of 1.56 to 1.36 and 1.30 to 1.14 microns respectively may be used.