WICHITA, Kan. — A bag used to collect lunar samples during the first manned mission to the moon legally belongs to an Illinois woman who bought it for $995 when it was mistakenly sold during a government auction, a judge ruled Wednesday.

Judge J. Thomas Marten, of the U.S. District Court in Wichita, said he doesn’t have the authority to reverse the sale of the bag used during the Apollo 11 moon mission in July 1969, even though it shouldn’t have gone up for auction.

The white bag, which has lunar material embedded in its fabric and which the government considers “a rare artifact, if not a national treasure,” was mistakenly sold as part of a criminal case against Max Ary, the former director of the Kansas Cosmosphere and Space Center, a museum in Hutchinson. Ary was convicted in November 2005 of stealing and selling museum artifacts, including some that were on loan from NASA.

Investigators found the Apollo 11 lunar bag in 2003 during a search of Ary’s garage. The government contends that due to a mix up in inventory lists and item numbers, the bag was mistakenly thought to be a different bag that the government recovered. Ary had auctioned off that bag, which was used during the 1972 Apollo 17 lunar landing, for $24,150 in 2001.

The U.S. Attorney’s Office wanted Marten to set aside the final forfeiture order and rescind the Apollo 11 bag’s sale to Nancy Carlson in Inverness, Illinois, saying that NASA hadn’t been properly notified of its forfeiture because the bag was misidentified. When she bought the bag, Carlson only knew that it had been used in a space flight, but not which one.

But Marten ruled that he didn’t have the authority to do that. The government obtained title to the bag and sold it to a good faith purchaser in a sale according to law, he noted.

NASA learned that the Apollo 11 bag had been sold without notice or permission when Carlson sent it to NASA at the Johnson Space Center in Houston for authentication. Carlson separately sued NASA in June in a federal court in Illinois, seeking the return of the bag.

Marten stopped short of ordering NASA to return the bag, noting that such a motion must be filed in the district where the property was seized.

The judge said NASA was a victim in this case, and that the importance and desirability of the bag stems solely from the efforts of the men and women of NASA whose “amazing technical achievements, skill and courage in landing astronauts on the moon and returning them safely have not been replicated in the almost half a century since the Apollo 11 landing.”

“Perhaps that fact, when reconsidered by the parties, will allow them to amicably resolve the dispute in a way that recognizes both of their legitimate interests, including Ms. Carlson’s legitimately acquired interest in the bag,” the judge wrote.

It unclear how much the Apollo 11 bag might fetch if auctioned off again and with the full knowledge of its significance.