The Solar System formed from a large cloud of dust and gas called a nebula. As the cloud contracted due to gravity, it began to spin faster, flattening into a disk. Small dust grains in the disk provided nuclei that attracted surrounding gas and other particles, eventually growing into planets. Over 100 million years, the planetesimals collided and accumulated material, forming the planets. The larger proto-planets were also able to collect gas to become the gas giant Jovian planets.