The generation of ultrashort pulses is a key to exploring the dynamic behaviour of matter on ever-shorter timescales. Recent developments have pushed the duration of laser pulses close to its natural limit-the wave cycle, which lasts somewhat longer than one femtosecond (1 fs = 10-15 s) in the visible spectral range. Time-resolved measurements with these pulses are able to trace dynamics of molecular structure, but fail to capture electronic processes occurring on an attosecond (1 as = 10-18 s) timescale. Here we trace electronic dynamics with a time resolution of </= 150 as by using a subfemtosecond soft-X-ray pulse and a few-cycle visible light pulse. Our measurement indicates an attosecond response of the atomic system, a soft-X-ray pulse duration of 650 +/- 150 as and an attosecond synchronism of the soft-X-ray pulse with the light field. The demonstrated experimental tools and techniques open the door to attosecond spectroscopy of bound electrons.