We describe the role of formamide, a product of the hydrolysis of hydrogen cyanide, as precursor of several components of nucleic acids under prebiotic conditions. When formamide is heated in the presence of montmorillonites, the efficient one-pot synthesis of purine, adenine, cytosine, and uracil is obtained. Along with these nucleobases, several components of the inosine pathway are obtained: 5-aminoimidazole-4-carboxamide, 5-formamidoimidazole-4-carboxamide and hypoxanthine. This almost complete catalogue of nucleic acid precursors is accompanied by N(9)-formylpurine, which, containing a masked glycosidic bond in its formyl moiety, is a plausible precursor of purine acyclonucleosides. In addition, montmorillonites differentially affect the rate of degradation of nucleobases when embedded in 2'-deoxyoligonucleotides; namely, montmorillonites protect adenine and guanine from the degradative action of formamide, while thymine degradation is enhanced. The oligonucleotide backbone reactivity to formamide is also affected; this shows that the interaction with montmorillonites modifies the rate of abstraction of the Halpha and Hbeta protons on the sugar moieties.