In materials science and biology, optical near-field microscopies enable spatial resolutions beyond the diffraction limit1, 2, but they cannot provide the atomic-scale imaging capabilities of electron microscopy3. Given the nature of interactions4, 5, 6, 7, 8 between electrons and photons, and considering their connections9, 10 through nanostructures, it should be possible to achieve imaging of evanescent electromagnetic fields with electron pulses when such fields are resolved in both space (nanometre and below) and time (femtosecond)11, 12, 13. Here we report the development of photon-induced near-field electron microscopy (PINEM), and the associated phenomena. We show that the precise spatiotemporal overlap of femtosecond single-electron packets with intense optical pulses at a nanostructure (individual carbon nanotube or silver nanowire in this instance) results in the direct absorption of integer multiples of photon quanta (nħω) by the relativistic electrons accelerated to 200keV. By energy-filtering only those electrons resulting from this absorption, it is possible to image directly in space the near-field electric field distribution, obtain the temporal behaviour of the field on the femtosecond timescale, and map its spatial polarization dependence. We believe that the observation of the photon-induced near-field effect in ultrafast electron microscopy demonstrates the potential for many applications, including those of direct space-time imaging of localized fields at interfaces and visualization of phenomena related to photonics, plasmonics and nanostructures.