Context. Pebble accretion is a newly discovered mechanism to quickly grow the cores of planets. In pebble accretion, gravity and gas drag conspire to yield large collisional cross sections for small particles in protoplanetary disks. However, before pebble accretion commences, aerodynamic deflection may act to prevent planetesimals from becoming large, because particles tend to follow gas streamlines. Aims. We derive the planetesimal radius where pebble accretion is initiated and determine the growth timescales of planetesimals by sweep-up of small particles. Methods. The equation of motion for a pebble, including gas drag and gravitational interactions, was integrated in three dimensions at distances of 1, 3, and 10 AU from the star. We ob...