We observe magnetic trapping of atomic nitrogen
(14N) and cotrapping of ground-state imidogen (
14NH, $X\phantom{\rule{0.2em}{0ex}}^{3}\ensuremath{\Sigma}^{\ensuremath{-}}$). Both are loaded directly from a room-temperature beam via buffer gas cooling. We trap approximately $1\ifmmode\times\else\texttimes\fi{}{10}^{11}$
14N atoms at a peak density of $5\ifmmode\times\else\texttimes\fi{}{10}^{11}\phantom{\rule{0.3em}{0ex}}{\mathrm{cm}}^{\ensuremath{-}3}$ at
550mK. The $12\ifmmode\pm\else\textpm\fi{}4\phantom{\rule{0.3em}{0ex}}\mathrm{s}$
1∕e lifetime of atomic nitrogen in the trap is consistent with a model for loss of atoms over the edge of the trap in the presence of helium buffer gas. Cotrapping of
14N and
14NH is accomplished, with
108 NH trapped molecules at a peak density of ${10}^{8}\phantom{\rule{0.3em}{0ex}}{\mathrm{cm}}^{\ensuremath{-}3}$.