The magnetic field is one of the most fundamental and ubiquitous physical observables, carrying information about all electromagnetic phenomena. For the past 30 years, superconducting quantum interference devices (SQUIDs) operating at 4K have been unchallenged as ultrahigh-sensitivity magnetic field detectors, with a sensitivity reaching down to 1fTHz-1/2 (1fT = 10-15T). They have enabled, for example, mapping of the magnetic fields produced by the brain, and localization of the underlying electrical activity (magnetoencephalography). Atomic magnetometers, based on detection of Larmor spin precession of optically pumped atoms, have approached similar levels of sensitivity using large measurement volumes, but have much lower sensitivity in the more compact designs required for magnetic imaging applications. Higher sensitivity and spatial resolution combined with non-cryogenic operation of atomic magnetometers would enable new applications, including the possibility of mapping non-invasively the cortical modules in the brain. Here we describe a new spin-exchange relaxation-free (SERF) atomic magnetometer, and demonstrate magnetic field sensitivity of 0.54fTHz-1/2 with a measurement volume of only 0.3cm3. Theoretical analysis shows that fundamental sensitivity limits of this device are below 0.01fTHz-1/2. We also demonstrate simple multichannel operation of the magnetometer, and localization of magnetic field sources with a resolution of 2mm.