Abstract Optimized synthesis and purification of erlotinib hydrochloride (N-(3-ethynylphenyl)- 6, 7-bis (2-methoxyethoxy) quinazoline-4-amine hydrochloride) were studied. Highly polar piperazine was used in a nucleophilic substitution reaction with the chlorinated intermediate