The spacecraft that reached out and grabbed a sample from an asteroid earlier this week may have collected so much material it prevented the lid of the sample holder from closing properly, allowing some of the precious dust and rocks to leak out, NASA officials said Friday evening.

Now the space agency is faced with the daunting task of stowing away the materials it does have without spilling a significant amount, a delicate procedure made all the more difficult by the weightless environment of space and the spacecraft being about 200 million miles away.

On Tuesday, an arm of the OSIRIS-REx spacecraft, designed by Lockheed Martin, touched the surface of the asteroid Bennu and fired nitrogen gas that stirred up gravel and dust to be captured by a collection device.

But the blast appears to have kicked up so much gravel and dust that some of it got jammed in the device, keeping the lid open. Still, NASA officials said they were confident that they have a large sample — far more than the 60 grams required — and will be able to stow the collection device away without too much leaking out.

“I am highly confident that the [operation] was successful, that it collected abundant mass,” said Dante Lauretta, a planetary scientist at the University of Arizona and the principal investigator of the mission. There was “definitely evidence of hundreds of grams of material, and possibly more. My big concern now is that the particles are escaping. Because we were almost a victim of our own success here, and some of the largest particles left the … flap open.”

Instead of trying to measure the amount of material collected, as originally planned, NASA now plans to store the collection device in the return capsule as early as Tuesday. Meanwhile, it is holding the spacecraft and collection device as steady as possible, fearful that any additional movement will cause more material to spill out.

“I was pretty concerned when I saw these images coming in, and I think the most prudent course of action is to very safely stow what we have and minimize any future mass loss,” Lauretta said.

But scientists won’t know how much material was collected until the spacecraft returns to Earth — in 2023.

“We’re going to have to wait till we get home to know precisely how much we have and as you can imagine that’s hard,” he said. “But the good news is we see a lot of material so where we are in the positive situation of having a lot more than the 60 grams that was required here.”

The mission was the first time NASA has ever taken a sample from one of the estimated 1 million asteroids in the solar system. Scientists believe the material could shed light on how the universe was formed and how water ended up on Earth.

More than 4.5 billion years old, Bennu is as large as the Empire State Building and looks like a giant walnut that scientists believe is full of scientific riches, such as carbon and water locked away inside clay materials.