The catalytic activity and selectivity of several compounds of the alkaline and alkaline-earth metals in the transesterification with methanol at 323 K of refined sunflower oil have been evaluated. Catalytic runs were conducted with a molar methanol/oil ratio of 12:1 in a batch reactor. The considered catalysts were Li, Na, K, Rb, Cs and Ca hydroxides, Na, K, Ca and Mg carbonates, Na and K bicarbonates, sodium phosphates as well as Ca and Mg oxides. Catalysts behaviour mainly depended on their homogeneous or heterogeneous character; that is, on their solubility in methanol. The alkaline metals hydroxides acted as homogeneous catalyst and were the most active ones; little differences were found among them. The K and Na carbonates, Na phosphate and CaO gave good results also. The evolution with reaction time of the selectivity for the different products also depended on the homogeneous or heterogeneous character of the catalyst, as well as on the alkaline or alkaline-earth nature of the metal. The chemical stability under reaction conditions of the most active heterogeneous catalysts has been investigated by checking the presence of the metals in the reaction mixture. This issue has received very little attention in the majority of the previous studies on heterogeneously-catalyzed biodiesel production. It must be stressed that a significant solubility in methanol of the solids has been found in some instances (e.g. K 2CO 3), therefore a contribution of homogeneous reaction routes cannot be discarded.