We report the design, construction, and performance of a near-infrared spectrograph for the 5-m Hale telescope at Palomar Observatory. The instrument is designed to operate between 1 and 5 mu m using existing infrared-array cameras. The spectrograph has two long-slit spectroscopy modes yielding resolutions (lambda/Delta lambda) of similar to 850 and similar to 3300 with a 0:'' 75 wide by 40 '' long slit. The spectrograph also has a direct-imaging mode in which a mirror is moved in front of the gratings giving a 10 '' x40 '' field of view through the same optical path. All mirror surfaces are cryogenically cooled to liquid-nitrogen temperatures to reduce thermal emission after dispersion. The instrument has performed to specifications and a representative set of data is presented.