Several basic metal-containing carbon xerogels (Na, K, Mg, and Zr) were obtained by polymerisation of resorcinol with formaldehyde in the presence of metallic precursors. A blank sample was also prepared without any metal addition. The carbonised derivatives were obtained by pyrolysis of the xerogels in nitrogen at 1000 degreesC. The samples were characterised by different techniques including thermal-mass spectrometry analysis, gas physisorption, mercury porosimetry, and X-ray diffraction. In addition, the basic character of the carbonised derivatives was determined by the Knoevenagel condensation test reaction. The heat treatment of the xerogels in helium produced the removal of moisture and organic precursors and carbonisation of the material. The blank, Mg-carbon and Zr-carbon xerogels and their carbonised derivatives are essentially macroporous materials, unlike the Na-carbon and K-carbon products. Some crystalline metallic phases with a low degree of cristallinity have been detected in the pyrolysed products. The metal-carbon derivatives are very active catalysts, especially when ethyl cyanoacetate is used as the methylenic compound, the Zr-carbon being the most selective catalyst in promoting the Knoevenagel reaction for all the methylenic compounds tested. The catalytic activity of the M-carbons seems to be conditioned by their basic character, and not by properties of the products such as their porous texture. (C) 2004 Elsevier Ltd. All rights reserved.