The nebular hypothesis states that the Solar System began as a rotating cloud of gas and dust called a nebula. The gravitational pull from this spinning mass eventually drew together to form the Sun at the center. As the remaining material continued to spin, it flattened into a disk. Eventually, clumps of rocky debris coalesced into asteroids and comets. These bodies grew larger until they became large enough to attract more material and become planets.