Synthesis of pethidine

Pethidine (meperidine), a synthetic opioid analgesic, was first prepared in 1939. Its classic synthesis exploits the acidity of the CH2 of phenylacetonitrile, activated both by the aromatic ring and by the cyano group.
With two equivalents of sodium amide, the nitrile is alkylated twice by bis(2-chloroethyl)methylamine; the second alkylation is intramolecular and closes the piperidine ring. Finally, the nitrile is converted into the ethyl ester with ethanol under acidic conditions.