The rock fragments were heated to more than 900 degrees Fahrenheit, and the rover’s instruments looked at the molecules that wafted away at the high temperatures. Then the scientists sifted through the results to figure out what might be genuine Martian organics.

The analysis was complicated in part because a cup of solvent within the rover’s mobile laboratory had leaked, contributing misleading signals. In addition, some of the readings could have come from contamination that had tagged along from Earth; others could have been produced in combustion as the sample was heated, which may have been the case in an earlier detection of organics by Curiosity.

“If we weren’t sure, we removed it,” Dr. Eigenbrode said.

In the end, a few smidgens of organics remained, including benzene and propane molecules.

“The detective work they did is worthy of Sherlock Holmes,” said Katherine Freeman , a professor of geosciences at Pennsylvania State University who was not involved with the research. “What they show is that organics were present early on in Mars.”

Intriguingly, the organics Dr. Eigenbrode and her colleagues detected looked like they were pieces that came from more complex material. The molecules could have come from something like kerogen, a component of fossil fuel that is found in coal and oil shale.

But the scientists cannot say what the larger molecules were or how they formed.

“We’ve considered three possible sources for the organics: geology, meteorites and biology,” she said. When they did experiments in their laboratory on Earth to bake samples containing those three types of organic carbon, the readings were all consistent with what was detected on Mars.

That means they do not have compelling evidence for a biological origin of the carbon, but the possibility is not ruled out, either. “It's on the table with all the other ones,” Dr. Eigenbrode said.