Comprehensive knowledge of the dynamic behaviour of electrons in condensed-matter systems is pertinent to the development of many modern technologies, such as semiconductor and molecular electronics, optoelectronics, information processing and photovoltaics. Yet it remains challenging to probe electronic processes, many of which take place in the attosecond (1 as = 10(-18) s) regime. In contrast, atomic motion occurs on the femtosecond (1 fs = 10(-15) s) timescale and has been mapped in solids in real time using femtosecond X-ray sources. Here we extend the attosecond techniques previously used to study isolated atoms in the gas phase to observe electron motion in condensed-matter systems and on surfaces in real time. We demonstrate our ability to obtain direct time-domain access to charge dynamics with attosecond resolution by probing photoelectron emission from single-crystal tungsten. Our data reveal a delay of approximately 100 attoseconds between the emission of photoelectrons that originate from localized core states of the metal, and those that are freed from delocalized conduction-band states. These results illustrate that attosecond metrology constitutes a powerful tool for exploring not only gas-phase systems, but also fundamental electronic processes occurring on the attosecond timescale in condensed-matter systems and on surfaces.