The concentration distribution and electronic structure of N atoms doped in multiwalled banboo-like carbon nanotubes (CNTs) are examined by photon energy-dependent x-ray photoelectron spectroscopy and x-ray absorption near edge structure. The inner part of the nanotube wall has a higher N concentration and contains molecular N-2 presumably intercalated between the graphite layers. These results are supported by the self-consistent charge-density-functional-based tight-binding calculation of double-walled CNTs, showing that the intercalation of N-2 is energetically possible and the graphite-like N structure conformer becomes more stable when the inner wall is more heavily doped. (C) 2004 American Institute of Physics