We report a method to initiate and investigate electrical discharges of ambient air/water molecules in a nanometer-sized gap. Our methodology is based on a typical atomic force microscopy (AFM) setup, in which a cylinder discharge gap of < or =5 nm could be configured between the AFM probe and substrate. We observed highly localized stochastic nanoexplosions in which the discharge probability is dominated by the electric field, material-specific surface reactions, and humidity. AFM results, coupled with the boundary element method (BEM), finite element method (FEM), and method of characteristics (MOC) simulations, further revealed the generation of transient shock waves in the nanoscale discharge. The propagation of shock fronts significantly facilitates the radial expansion of the ionized particles, leading to the formation of microscale patterns on selected substrates. Our findings provide an initial understanding of nanoscale discharge and could be relevant to a few applications including nano/microstructuring, microelectronics, and plasma-assisted depositions.