N-Alkoxymethylation of heterocyclic compounds with diethyl phosphite via cleavage of P–O bond was investigated and a series of N3-ethoxymethylated heterocyclic compounds were synthesized. A mechanism in which diethyl phosphite acts as an efficient surrogate of ethanol was proposed and supported by several evidences.