Physical processes that could facilitate coherent control of light propagation are under active exploration1,2,3,4,5. In addition to their fundamental interest, these efforts are stimulated by practical possibilities, such as the development of a quantum memory for photonic states6,7,8. Controlled localization and storage of photonic pulses may also allow novel approaches to manipulating of light via enhanced nonlinear optical processes9. Recently, electromagnetically induced transparency10 was used to reduce the group velocity of propagating light pulses11,12 and to reversibly map propagating light pulses into stationary spin excitations in atomic media13,14,15,16. Here we describe and experimentally demonstrate a technique in which light propagating in a medium of Rb atoms is converted into an excitation with localized, stationary electromagnetic energy, which can be held and released after a controllable interval. Our method creates pulses of light with stationary envelopes bound to an atomic spin coherence, offering new possibilities for photon state manipulation and nonlinear optical processes at low light levels.