The invention relates to new N-phosphonylmethoxyalkyl derivatives of pyrimidine and purine bases of the general formula I ##STR1## wherein R is a hydrogen atom or a hydroxymethyl group and B is a pyrimidin-1-yl, pyrimidin-3-yl, purin-3-yl, purin-7-yl or purin-9-yl residue but not an adenin-9-yl residue, and the salts thereof with alkali metals, ammonia or amines.