A photodetector comprising a diode of an n-type gallium arsenide single crystal substrate, a plurality of step-graded matching layers of indium gallium arsenide alloy disposed on said substrate, the matching layer immediately contacting the substrate having the lowest proportion of indium arsenide and the matching layers successively farther from said substrate having successively increasing concentrations of indium, and having successively decreasing n-type charge carrier concentrations, a particular epitaxial layer disposed on the last of said matching layers of very lightly doped n-type In.sub.x Ga.sub.(1.sub.-x) As, where x is selected to make the bandgap substantially equal to the energy of the photons to be detected and the charge carrier concentration is substantially less than any other semiconductor portion of said diode, an epitaxial layer of p-type In.sub.y Ga.sub.(1.sub.-y) As disposed on said particular n-type layer, where y is selected to be at least 0.02 less than x, said p-type layer forming a window for said photons and a heterojunction with said particular n-type layer, and electrode means for coupling to said particular n-type layer and said p-type layer, said electrode means being adapted to admit said photons first to said p-type layer and thereafter to said particular n-type layer.