NASA confirmed Monday that its Perseverance Mars rover succeeded in collecting its first rock sample for scientists to pore over when a future mission eventually brings it back to Earth.

"I've got it!" the space agency tweeted, alongside a photograph of a rock core slightly thicker than a pencil inside a sample tube.

The sample was collected on September 1, but NASA was initially unsure whether the rover had successfully held onto its precious cargo, because initial images taken in poor light were unclear.

After taking a new photo so mission control could verify its contents, Perseverance transferred the tube to the rover's interior for further measurements and imaging, then hermetically sealed the container.

The drill hole from Perseverance's sample collection is seen in an image taken on September 1, 2021
The drill hole from Perseverance's sample collection is seen in an image taken on September 1, 2021 NASA / Handout

"This is a momentous achievement and I can't wait to see the incredible discoveries produced by Perseverance and our team," NASA administrator Bill Nelson said in a statement.

Thomas Zurbuchen, associate administrator for science, likened the achievement to the first samples of rock taken from the Moon, which are still invaluable to researchers today.

Perseverance's sampling and caching system is the most complex mechanism ever sent to space, with over 3,000 parts.

Its first target was a briefcase-sized rock nicknamed "Rochette" from a ridgeline that is particularly interesting from a geological perspective as it contains ancient layers of exposed bedrock.

Perseverance uses a drill and a hollow coring bit at the end of its 7-foot-long (2-meter-long) robotic arm to extract samples.

Graphic on the Mars Perseverance rover and Ingenuity helicopter
Graphic on the Mars Perseverance rover and Ingenuity helicopter AFP / Gal ROMA

After coring the rock, the rover vibrated the drill bit and tube for one second, five separate times.

This procedure is called "percuss to ingest" and is meant to clear the lip of the tube of residual material, and cause the sample to slide down the tube.

Perseverance landed on an ancient lake bed called the Jezero Crater in February, on a mission to search for signs of ancient microbial life using a suite of sophisticated instruments mounted on its turret.

It is also trying to better characterize the Red Planet's geology and past climate.

The first part of the rover's science mission, which will last hundreds of sols or Martian days, will be complete when it returns to its landing site.

By then, it will have traveled somewhere between 1.6 and 3.1 miles (2.5 and five kilometers) and may have filled up to eight of its 43 sample tubes.

It will then travel to Jezero Crater's delta region, which might be rich in clay minerals. On Earth, such minerals can preserve fossilized signs of ancient microscopic life.

Eventually NASA wants to send back the samples taken by the rover in a joint mission with the European Space Agency, sometime in the 2030s.

Its first attempt at taking a sample in August failed after the rock was too crumbly to withstand the robot's drill.