Nitrogen oxides are thought to play a significant role as a nitrogen reservoir and to potentially participate in the formation of more complex species. Until now, only NO, N$_2$O and HNO have been detected in the interstellar medium. We report the first interstellar detection of nitrous acid (HONO). Twelve lines were identified towards component B of the low-mass protostellar binary IRAS~16293--2422 with the Atacama Large Millimeter/submillimeter Array, at the position where NO and N$_2$O have previously been seen. A local thermodynamic equilibrium model was used to derive the column density ($sim$ 9 $times$ 10$^{14}$ cm$^{-2}$ in a 0.5 beam) and excitation temperature ($sim$ 100 K) of this molecule. HNO, NO$_2$, NO$^+$, and HNO$_3$ were also searched for in the data, but not detected. We simulated the HONO formation using an updated version of the chemical code Nautilus and compared the results with the observations. The chemical model is able to reproduce satisfactorily the HONO, N$_2$O, and NO$_2$ abundances, but not the NO, HNO, and NH$_2$OH abundances. This could be due to some thermal desorption mechanisms being destructive and therefore limiting the amount of HNO and NH$_2$OH present in the gas phase. Other options are UV photodestruction of these species in ices or missing reactions potentially relevant at protostellar temperatures.