We present the first astronomical detection of a diatomic negative ion, the cyanide anion CN − , and quantum mechanical calculations of the excitation of this anion by means of collisions with para-H 2 . The anion CN − is identified by observing the J = 2−1 and J = 3−2 rotational transitions in the C-star envelope IRC +10216 with the IRAM 30-m telescope. The U-shaped line profiles indicate that CN − , like the large anion C 6 H − , is formed in the outer regions of the envelope. Chemical and excitation model calculations suggest that this species forms from the reaction of large carbon anions with N atoms, rather than from the radiative attachment of an electron to CN, as is the case for large molecular anions. The unexpectedly high abundance derived for CN − , 0.25% relative to CN, indicates that its detection in other astronomical sources is likely. A parallel search for the small anion C 2 H − remains inconclusive, despite the previous tentative identification of the J = 1−0 rotational transition. The abundance of C 2 H − in IRC +10216 is found to be vanishingly small, <0.0014% relative to C 2 H.