A process of production of trazodone or trazodone hydrochloride that comprises; (a) preparing an organic phase comprising trazodone in at least one organic solvent; (b) preparing an aqueous phase comprising at least one basic compound; (c) mixing said aqueous phase with said organic phase; (d) heating at a temperature of at least 40° C. for at least 30 minutes; (e) recovering said trazodone; and, optionally, (f) treating said trazodone with hydrochloric acid to obtain trazodone hydrochloride. Trazodone or trazodone hydrochloride comprising less than 15 ppm of alkylating substances, and a pharmaceutical composition comprising said trazodone hydrochloride.