During the initial stages of planet formation in circumstellar gas disks, dust grains collide and build up larger and larger bodies. How this process continues from metre-sized boulders to kilometre-scale planetesimals is a major unsolved problem: boulders are expected to stick together poorly, and to spiral into the protostar in a few hundred orbits owing to a 'headwind' from the slower rotating gas. Gravitational collapse of the solid component has been suggested to overcome this barrier. But even low levels of turbulence will inhibit sedimentation of solids to a sufficiently dense midplane layer, and turbulence must be present to explain observed gas accretion in protostellar disks. Here we report that boulders can undergo efficient gravitational collapse in locally overdense regions in the midplane of the disk. The boulders concentrate initially in transient high pressure regions in the turbulent gas, and these concentrations are augmented a further order of magnitude by a streaming instability driven by the relative flow of gas and solids. We find that gravitationally bound clusters form with masses comparable to dwarf planets and containing a distribution of boulder sizes. Gravitational collapse happens much faster than radial drift, offering a possible path to planetesimal formation in accreting circumstellar disks.