We report on the detection of anhydrous hydrochloric acid (hydrogen chlorine, HCl) in the carbon-rich star IRC+10216 using the spectroscopic facilities onboard the Herschel satellite. Lines from J=1-0 up to J=7-6 have been detected. From the observed intensities, we conclude that HCl is produced in the innermost layers of the circumstellar envelope with an abundance relative to H2 of 5x10^-8 and extends until the molecules reach its photodissociation zone. Upper limits to the column densities of AlH, MgH, CaH, CuH, KH, NaH, FeH, and other diatomic hydrides have also been obtained.