The feat, carried out by the Japan Aerospace Exploration Agency (JAXA) craft Hayabusa2, is the first time such a sample has been retrieved from an asteroid.
The craft made its own crater in April by dropping a copper impactor, effectively a heavy, explosive-packed copper plate to blow a hole in the side of the asteroid.
JAXA said that data sent from Hayabusa2 confirms the touchdown sequence, including the discharge of a projectile for sampling, was completed successfully and that the craft is still functioning normally.
“It was a success, a big success,” said Takashi Kubota, a Hayabusa2 project member at JAXA.
“We achieved success in all scheduled procedures.”
Landing was a challenge for Hayabusa2 because of a risk of getting hit by dust and debris that remain at the crater.
“Everything went perfectly, even better than perfect, as if Hayabusa were reading our minds,” he added.
The moment the success was announced in the command centre, everyone stood up, cheered and applauded, some of them making victory signs.
The spacecraft had started its gradual descent on Wednesday.
In the final landing phase on Thursday, Hayabusa2 hovered at the height of 30 metres above the asteroid and quickly found its landing marker left from the earlier mission.
The actual landing took just a few seconds.
During the touchdown, Hayabusa2 extended its sampling tube to the ground, shot a pinball-size bullet to crack the surface and sucked up the resulting debris.
JAXA now plans to send the spacecraft, which is on its way back to its home position above the asteroid, to examine the landing site from above.
The asteroid, named Ryugu after an undersea dragon palace in a Japanese folk tale, is about 300 million kilometres from Earth.
Hayabusa2 is expected to leave the asteroid to return to Earth at the end of next year, with the samples set for scientific study.
Last year JAXA began developing a radar designed to detect space debris as small as 10 centimetres in order to help spacecraft and satellites avoid collisions.