The Red Planet is gray underneath.

NASA’s Curiosity rover completed drilling into Mars for the first time this week, mission scientists said Wednesday, smashing rock into fine gray powder for analysis in the coming days.

After working through minor software glitches, operators at the Jet Propulsion Laboratory, who run the mission for NASA, commanded the SUV-size robot to bore a four-inch-deep hole.

The robot then collected two to three tablespoons of powder, which it swirled through sampling instruments to scour any contamination from Earth.

The drill — which can both spin and pound — was the last of the rover’s instruments to check out. Making sure it worked as designed was vital for the mission’s primary goal of finding habitats friendly to current or past life.

A timeline of the Mars rover Curiosity through its two-year mission on Mars.

“It’s a real big turning point for us,” said mission scientist John Grotzinger.

Scientists are eager to peer beneath the radiation-blasted surface of Mars for signs of ancient environments that once may have been ripe for microbes or other organisms.

While the planet’s surface appears barren, the subsurface may prove more interesting, said Joel Hurowitz, a JPL scientist. “Our time capsule in a sense is the rocks themselves,” he said, offering a window on the planet some 4 billion years deep.

Operators said they chose an ideal location for first drilling — a sandstone-like rock called John Klein, for a late JPL scientist. The paving-stone pattern of John Klein and other rocks nearby suggests they formed in flowing water.

“These rocks have a rich geologic history,” Hurowitz said.

Mars’s famous color comes from rusty dust that coats the surface. Getting beneath that layer is “something the science team is really excited about,” said Hurowitz. “We get to see powder that hasn’t been affected by weathering.”

The JPL team revealed minor glitches in the drill’s software in a teleconference with reporters, but said there was no danger to the rover. They successfully worked around the problem.

The drilling adds to Curiosity’s accomplishments, making it the first mobile robot to bore into another world. Apollo astronauts used hand drills to peek beneath the surface of the moon, while NASA’s earlier Mars rovers carried only simple tools for scraping rocks.

The $2.5 billion mission dropped Curiosity into Gale Crater last August for a two-year primary mission.