We report here the first detection in the interstellar medium of the cyanomidyl radical (HNCN). Using the Yebes 40m and the IRAM 30m telescopes, we have targeted the doublets of the $N$=2$-$1, 4$-$3, 5$-$4, 6$-$5, and 7$-$6 transitions of HNCN toward the molecular cloud G+0.693-0.027. We have detected three unblended lines of HNCN, these are the $N$=6$-$5 doublet and one line of the $N$=4$-$3 transition. Additionally we present one line of the $N$=5$-$4 transition partially blended with emission from other species. The Local Thermodynamic Equilibrium best fit to the data gives a molecular abundance of (0.91$pm$0.05)$times$10$^{-10}$ with respect to H$_2$. The relatively low abundance of this species in G+0.693-0.027, and its high reactivity, suggest that HNCN is possibly produced by gas-phase chemistry. Our work shows that this highly reactive molecule is present in interstellar space, and thus it represents a plausible precursor of larger prebiotic molecules with the NCN backbone such as cyanamide (NH$_2$CN), carbodiimide (HNCNH) and formamidine (NH$_2$CHNH).