Heterocyclic compounds are obtained by reacting acetylenic hydrocarbons with ammonia or primary amines at below about 200 DEG C. and under pressure in the presence of a catalyst comprising an anhydrous metal salt or an oxide, hydroxide or alcoholate of a metal of the first, second or third periodic group. Specified hydrocarbons are acetylene, methylacetylene, ethylacetylene, vinylacetylene and phenylacetylene. Specified amines are methylamine, ethylamine, propylamine, butylamine, dodecylamine, hydroxyethylamine, chlorethylamine, aniline, benzylamine, benzidine and naphthylamines. Specified catalysts are cuprous oxide, mercuric oxide, zinc oxide and hydroxide, cadmium hydroxide, sodium and aluminium alcoholates, chlorides of silver, copper, mercury, zinc, cadmium, cobalt and iron, and sulphates of cadmium, cobalt and copper; the catalysts may be used in admixture with one another or deposited on carriers. The reaction is preferably effected in vessels having enamelled walls. In the examples: (1) ammonia and acetylene, heated to 170--180 DEG C. under 25 atm. pressure in the presence of zinc chloride, zinc hydroxide or cuprous chloride, yield a product believed to be trimethylpyridine; its picramic acid compound is described; (2) methylamine and acetylene are heated to 160 DEG C. under 20--25 atm. pressure in the presence of cuprous chloride, cobalt chloride or silver chloride; a product comprising mono-, di- and tri-methyl derivatives of pyridine and pyrrole is obtained, from which a mixture of picramic acid compounds is obtainable; the product yields pyrrole when distilled with zinc dust; according to the Provisional Specification, the product contains pyrrolidine derivatives; (3) n-butylamine and acetylene, heated as in example 2 in the presence of cadmium sulphate, cuprous chloride or zinc chloride, yield a product comprising mainly n-butylpyrroline, from which a picramic acid compound is obtainable; the product yields pyrrole when distilled with zinc dust; (4) dodecylamine and acetylene, heated as in example 2 in the presence of cuprous chloride, yield a product of the formula C16H31N which forms a hydrochloride and is convertible into a dihydro derivative by hydrogenation; both the product and its dihydro derivative yield pyrrole when distilled with zinc dust; (5) ethanolamine and acetylene are heated to 155 DEG C. under 25 atm. pressure in the presence of aluminium alcoholate, sodium alcoholate, zinc or cadmium hydroxide, or zinc or mercury oxide; a product which forms a picramic acid compound, and yields pyrrole when distilled with zinc dust, is obtained; (6) aniline and acetylene, heated to 170 DEG C. under 20 atm. pressure in the presence of cuprous chloride, yield a product which contains quinaldine and from which two picramic acid compounds are obtainable; (7) dodecylamine is heated with phenylacetylene to 140 DEG C. in an autoclave in the presence of cuprous chloride; a product of the formula C28H39N is obtained, which yields pyrrole when distilled with zinc dust. Specifications 280,511, 332,258, [both in Class 2 (iii)], and 348,985 are referred to.