Gas giants such as Saturn and Jupiter may have been built by centimetre-sized pebbles that formed 4.5 billion years ago from dust and ice swirling around the newborn Sun, a new study suggests.

Researchers have found that the primordial pebbles rapidly melded into the cores of gas giants such as Jupiter and Saturn.

Earlier theories had suggested that building a giant planet required a stately agglomeration of much-bigger chunks, each about a kilometre across.

But scientists found it difficult to explain how this process could have finished in just a few million years, before the disk of dust around the Sun dissipated.

The pebble-accretion idea, put forth in 2012 by Michiel Lambrechts and Anders Johansen of Lund University in Sweden, seemed to solve this problem, 'Nature' reported.

It was able to explain how a planetary core could form rapidly, as friction with gas in the disk would have slowed pebbles enough for them to be accreted onto an embryonic planet.

However, simulations that tested the theory generated hundreds of Earth-sized objects flying around the Sun, rather than the handful of larger objects - roughly ten times the size of Earth - that are thought to have formed the cores of the giant planets.

Lead author Harold Levison, a planetary scientist at the Southwest Research Institute in Boulder, Colorado, fixed that problem by allowing more time for the pebbles to develop into planetary cores.

"We're doing simulations that actually allow the growing planetesimals to interact and collide with each other," said co-author Katherine Kretke, an astronomer at the Southwest Research Institute.

The researchers found that embryonic planets that were only slightly larger than their neighbours tended to bully the others out of the disk.

Depending on the starting conditions, the team's simulations generally yielded between one and four gas-giant planets, similar to Jupiter, Saturn, Uranus and Neptune.

Their existence and positions from the Sun align well with another leading theory of planetary formation, the Nice model, which describes how the gas-giant planets began to interact with each other once they had grown to full size.