Adaptive shaping of the phase and amplitude of femtosecond laser pulses has been developed into an efficient tool for the directed manipulation of interference phenomena, thus providing coherent control over various quantum-mechanical systems1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Temporal resolution in the femtosecond or even attosecond range has been demonstrated, but spatial resolution is limited by diffraction to approximately half the wavelength of the light field (that is, several hundred nanometres). Theory has indicated11, 12 that the spatial limitation to coherent control can be overcome with the illumination of nanostructures: the spatial near-field distribution was shown to depend on the linear chirp of an irradiating laser pulse. An extension of this idea to adaptive control, combining multiparameter pulse shaping with a learning algorithm, demonstrated the generation of user-specified optical near-field distributions in an optimal and flexible fashion13. Shaping of the polarization of the laser pulse14, 15 provides a particularly efficient and versatile nano-optical manipulation method16, 17. Here we demonstrate the feasibility of this concept experimentally, by tailoring the optical near field in the vicinity of silver nanostructures through adaptive polarization shaping of femtosecond laser pulses14, 15 and then probing the lateral field distribution by two-photon photoemission electron microscopy18. In this combination of adaptive control1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and nano-optics19, we achieve subwavelength dynamic localization of electromagnetic intensity on the nanometre scale and thus overcome the spatial restrictions of conventional optics. This experimental realization of theoretical suggestions11, 12, 13, 16, 17, 20 opens a number of perspectives in coherent control, nano-optics, nonlinear spectroscopy, and other research fields in which optical investigations are carried out with spatial or temporal resolution.