Erlotinib can be obtained by three related ways: 1) Alkylation of 3,4-dihydroxybenzoic acid ethyl ester (I) with 2-bromoethyl methyl ether (II) by means of K2CO3 and tetrabutylammonium iodide (TBAI) in refluxing acetone gives 3,4-bis(2-methoxyethoxy)benzoic acid ethyl ester (III), which is nitrated with HNO3 in acetic acid to yield 4,5-bis(2-methoxyethoxy)-2-nitrobenzoic acid ethyl ester (IV). Reduction of ester (IV) with H2 over PtO2 in ethanol/HCl affords the corresponding aniline derivative (V), which is cyclized with ammonium formate (VI) in formamide at 165 C to provide 6,7-bis(2-methoxyethoxy)-quinazolin-4(3H)-one (VII). Reaction of quinazoline (VII) with oxalyl chloride in refluxing chloroform gives the expected 4-chloroquinazoline derivative (VIII), which is finally condensed with 3-ethynylaniline (IX) in refluxing isopropanol containing pyridine. 2) Reaction of the 4-chloroquinazoline derivative (VIII) with 4-(3-aminophenyl)-2-methyl-3-butyn-2-ol (X) in refluxing acetonitrile gives the secondary amine (XI), which is finally treated with anhydrous solid NaOH in refluxing either 1-butanol, 2-butanol, isopropanol or 2-methoxyethanol. 3) Reaction of 3-bromonitrobenzene (XII) with trimethylsilylacetylene (XIII) by means of a Pd catalyst and Cu2I in hot TEA gives 3-(trimethylsilylethynyl)nitrobenzene (XIV), which is reduced with H2 over Pt/Al2O3 in isopropanol to provide 3-(trimethylsilylethynyl)aniline (XV). Condensation of the aniline (XV) with the quinazoline derivative (VIII) in refluxing isopropanol affords the silylated quinazoline derivative (XVI), which is finally deprotected with TBAF in THF.