The Sun and the planets formed together, 4.6 billion years ago, from a cloud of gas and dust called the solar nebula. A shock wave from a nearby supernova explosion probably initiated the collapse of the solar nebula. The Sun formed in the center, and the planets formed in a thin disk orbiting around it.