A novel nanolithography technique is developed for nanoscale patterning of polymers: atomic force microscope assisted electrostatic nanolithography (AFMEN). In AFMEN, nanostructures are generated by mass transport of polymeric material within an initially uniform, planar film. The combination of localized softening of attolitres of polymer, a strongly non-uniform electric field to polarize and manipulate the soften dielectric, and single-step process methodology using conventional atomic force microscopy (AFM), establishes a new paradigm for polymer nanolithography. We develop a basic theoretical understanding of the processes associated with AFMEN and present modeling of the relevant phenomena. The analysis of polymer heating indicates that the AFMEN resolution is not directly limited by the radius of the AFM tip, which is distinctly different from alternative AFM–based lithographic techniques. Instead, the feature size depends critically on the thermal characteristics of the polymer, such as its thermal conductivity. The dielectric properties of the polymer play a secondary role, affecting the magnitude of the electric field but do not directly impact the feature size. The nanostructure shape is determined by the competition between the ponderomotive forces acting on the dielectric material in non–uniform electric field, and the polymer surface tension. An exact analytical solution, as well as numerical solutions, are determined for the electric field distribution in the tip–sample junction, which allow prediction of the nanostructure geometry. The response of the AFM tip during the nanolithography process is investigated. An analysis of the free energy of the system, comprising AFM tip, sample surface and water meniscus, shows that the tip is spontaneously lifted away from the polymer surface. The mechanical work required to lift the tip is drawn from the energy of electric field. In addition, water condensation in the proximity of nanoscale asperities such as an AFM tip is studied. A general framework based on the density functional theory (DFT) is developed and applied to describe the liquid meniscus condensation, providing the first (to the best of our knowledge) molecular–level theory of water condensation on the nanoscale in the presence of external electric fields.