We present results from the first on-sky demonstration of a prototype astronomical integrated photonic spectrograph (IPS) using the Anglo-Australian Telescope near-infrared imaging spectrometer (IRIS2) at Siding Spring Observatory to observe atmospheric molecular OH emission lines. We have succeeded in detecting upwards of 27 lines, and demonstrated the practicality of the IPS device for astronomy. Furthermore, we present a laboratory characterization of the device, which is a modified version of a commercial arrayed-waveguide grating multiplexer. We measure the spectral resolution full-width-half-maximum to be 0.75 ± 0.05nm (giving R = λ/δλ = 2100 ± 150 at 1500nm). We find the free spectral range to be 57.4 ± 0.6nm and the peak total efficiency to be -65%. Finally, we briefly discuss the future steps required to realize an astronomical instrument based on this technology concept.