We have fabricated two-dimensional p–n junctions by local Si-implantation doping of a p-modulation doped GaAs/InyGa1−yAs/AlxGa1−xAs heterostructure. The base material has at a hole density of and the mobility is . The local compensation doping was done by focused ion beam implantation of Si and the resulting two-dimensional electron gas had a carrier density of with a mobility of . The current–voltage characteristic shows clear rectifying behavior. The capacitance of the junctions is and depends only weakly on the reverse bias. Electro-luminescence can be observed at room temperature as well as at low temperatures.