NASA's James Webb Space Telescope has captured the first-ever clear evidence for carbon dioxide in the atmosphere of a planet outside the solar system.

The finding, to be published in the journal Nature, offers hope that in the future, Webb may be able to detect and measure carbon dioxide in the thinner atmospheres of smaller rocky planets.

This observation of a gas giant planet named 'WASP-39 b' which is orbiting a Sun-like star 700 light-years away provides important insights into the composition and formation of the planet, the US space agency said in a statement late on Thursday.

"As soon as the data appeared on my screen, the whopping carbon dioxide feature grabbed me. It was a special moment, crossing an important threshold in exoplanet sciences," said Zafar Rustamkulov, a graduate student at Johns Hopkins University.

WASP-39 b is a hot gas giant with a mass roughly one-quarter that of Jupiter (about the same as Saturn) and a diameter 1.3 times greater than Jupiter.

Previous observations from other telescopes, including NASA's Hubble and Spitzer space telescopes, revealed the presence of water vapor, sodium, and potassium in the planet's atmosphere.

Webb's unmatched infrared sensitivity has now confirmed the presence of carbon dioxide on this planet as well.

"Detecting such a clear signal of carbon dioxide on WASP-39 b bodes well for the detection of atmospheres on smaller, terrestrial-sized planets," said Natalie Batalha of the University of California at Santa Cruz, who leads the team.

Understanding the composition of a planet's atmosphere is important because it tells us something about the origin of the planet and how it evolved.

"Carbon dioxide molecules are sensitive tracers of the story of planet formation," said Mike Line of Arizona State University.