Satisfactory yields of 4-substituted pyrimidines and bicyclic pyrimidines are produced from α-methyl or α-methylene ketones when reacted with formamide and tetrakis(triphenylphosphine)palladium(0) or a 1:2 mixture of palladium(II) acetate and triphenylphosphine as catalysts. Under the same reaction conditions pyridines or imidazole are formed from 1,3- or 1,2-diketones.