Persistent photoconductivity (PPC) effect associated with a two-dimensional electron gas (2DEG) in an AlGaN/GaN heterojunction device has been observed. As a consequence, the device was observed to be sensitive to light and the sensitivity was associated with a permanent photoinduced increase in the 2DEG carrier mobility and density. By formulating the PPC buildup and decay kinetics, we attributed the observed increase in the 2DEG carrier density and mobility to the photoionization of deep level impurities (DX like centers) in the AlGaN barrier material. In the PPC state, we were able to continuously vary the 2DEG carrier density in a single sample through photoexcitation and it has been found that the 2DEG carrier mobility increases almost linearly with the carrier density in the 2DEG channel. At 10 K, an electron mobility of 5800 cm2/V·s has been obtained in a PPC state. Implications of these observations on the device applications based on AlGaN/GaN heterojunctions have also been discussed.