A new route has been developed to prepare polyaniline (PANI)/ layered double hydroxides (LDHs) nanocomposites through in situ chemical oxidative polymerization of metanilic acid (m-NH2C6H4SO3H) intercalated in MgAl LDH under nitrogen atmosphere by using the pre-intercalated nitrate as the oxidizing agent. The whole process involves the synthesis of the precursor LDHs [Mg2Al (OH)6](NO3)·nH2O, the intercalation of the monomer metanilic acid into LDH and its in situ polymerization between the layers by thermal treatment under nitrogen atmosphere. The interlayer polymerization was monitored by thermogravimetry (TG)-differential thermal analysis (DTA) - mass spectrometry (MS), UV-vis spectroscopy and in situ high temperature X-ray diffraction (HT-XRD). UV-vis spectroscopy give strong evidence on the polymerization of the intercalated metanilic acid, with the increase of the interlayer distance and broadening of the diffraction peaks. It has been found by the in situ technologies that the co-intercalated nitrate anions act as the oxidizing agent which participate in the polymerization of the interlayer monomers under nitrogen atmosphere by heating from 300 oC to 350 oC.