Astronomers have spotted a huge planet that they thought would not be able to exist.

The vast world – a Jupiter-like exoplanet that is 30 light-years away – could force us to re-write our understanding of how planets form, scientists say.

It orbits around a star, known as GJ 3512, which is a red dwarf only a tenth as big our own Sun. Astronomers did not expect that such a small star would be able to serve as home to such a vast planet.

"Around such stars there should only be planets the size of the Earth or somewhat more massive Super-Earths," said Christoph Mordasini, professor at the University of Bern and member of the National Centre of Competence in Research (NCCR) PlanetS. "GJ 3512b, however, is a giant planet with a mass about half as big as the one of Jupiter, and thus at least one order of magnitude more massive than the planets predicted by theoretical models for such small stars."

The Spanish-led team who first spotted the planet wrote in the journal Science that the newly confirmed planet did not form the usual, gradual way, where a solid core of merging particles takes shape before a gas buildup. Instead, in a surprise to scientists, the planet seems to have arisen straight from gas.

Best Nasa pictures of the month Show all 10 1 /10 Best Nasa pictures of the month Best Nasa pictures of the month The eye of Hurricane Dorian as captured by Nasa astronaut Nick Hague from onboard the International Space Station (ISS) on 3 September Nasa/EPA Best Nasa pictures of the month The River Nile and its delta captured at night from the ISS on 2 September Nasa Best Nasa pictures of the month The galaxy Messier 81, located in the northern constellation of Ursa Major, as seen by Nasa's Spitzer Space Telescope Nasa/JPL-Caltech Best Nasa pictures of the month The flight path Soyuz MS-15 spacecraft is seen in this long exposure photograph as it launches from the Baikonur Cosmodrome in Kazakhstan on 25 September Nasa/Bill Ingalls Best Nasa pictures of the month Danielson Crater, an impact crater in the Arabia region of Mars, as captured by Nasa's Mars Reconnaissance Orbiter spacecraft Nasa/JPL-Caltech Best Nasa pictures of the month A team rehearses landing and crew extraction from Boeing's CST-100 Starliner, which will be used to carry humans to the International Space Station at the White Sands Missile Range outside Las Cruces, New Mexico Nasa/Bill Ingalls Best Nasa pictures of the month Bound for the International Space Station, the Soyuz MS-15 spacecraft launches from the Baikonur Cosmodrome in Kazakhstan on 25 September Nasa/Bill Ingalls Best Nasa pictures of the month Hurricane Dorian as seen from the ISS on 2 September Nasa Best Nasa pictures of the month A string of tropical cyclones streams across Earth's northern hemisphere in this picture taken from the ISS on 4 September Nasa Best Nasa pictures of the month The city of New York as seen from the ISS on 11 September Nasa

Lead author Juan Carlos Morales of the Institute of Space Studies of Catalonia said the planet may be almost as big as its star. A year there is about 200 days.

"It was very exciting finding this planet because it was completely unexpected," Morales wrote in an email. The results indicate "a new population of massive planets may also exist around low-mass stars."

Morales and his team maintain that gravitational instability in a young star's disk of gas and dust could, in some cases, result in the quick formation of huge gas planets — even when the star is minuscule. This new world is "an extraordinary candidate" for this process, said Hubert Klahr of Max Planck Institute for Astronomy in Germany, part of the research team. "This find prompts us to review our models."

In a companion article, Yale University astronomer Greg Laughlin, who was not involved in the study, pointed out that more than 4,000 so-called exoplanets have been confirmed in solar systems outside our own. While another new one, by itself, is no longer particularly noteworthy, he said, "one that challenges current theories of planet formation can animate astronomers."

The planet orbiting this particularly small and cool red dwarf star, officially known as GJ 3512, is at least half the mass of Jupiter. Scientists are unable to measure its dimensions, but models indicate it may be comparable to Jupiter in size, according to Morales.

Using observatories in Spain, the researchers repeatedly studied the star's wobbling motion to disclose the planet in its lopsided orbit, rather than rely on the transit method in which a brief, periodic dimming of starlight indicates a planet passing in front of its star.

The star is so faint it almost didn't make it into the group's survey. Scientists needed more small stars for sampling and so added a few at the last minute.

"We were lucky to do so because otherwise we would have never made this discovery," Ignasi Ribas, director of the Catalonia space studies institute, said in a statement.

Morales and his colleagues continue to search for a second planet orbiting this dwarf star. There may have been a third planet that was ejected from the system long ago, they noted.