The tumors could be primary lung cancers, meaning they originated in the lung. Or they could be growths that spread to her lung from cancer in another organ. The justice had colon cancer in 1999 and pancreatic cancer in 2009.

“When you have two lesions in the lung, it usually means it came from someplace else,” said Dr. Raja Flores, chairman of thoracic surgery at the Icahn School of Medicine at Mount Sinai in Manhattan. “It’s probably something that spread from the pancreas to the lungs.”

That Justice Ginsburg is alive 10 years after being treated for pancreatic cancer — which is often rapidly fatal — indicates that she probably had a relatively slow-growing form of the disease. Therefore, Dr. Flores said, he expected that the tumors in her lungs would also tend to be slow-growing, what he calls “turtles.”

Testing on the tissue removed during surgery will determine the diagnosis, he said.

“If they see pancreas cells, or colon cells, or just lung cells, that will help dictate further treatment,” Dr. Flores said, but he added that the justice might not need any more treatment.

“The fact that this is out, and there is no evidence of disease anywhere else, makes me think she is not in any danger of checking out anytime soon,” he said. “She should be up walking around tomorrow. As long as she doesn’t get a blood clot or pneumonia, she’s fine. I imagine her back on the bench in six to eight weeks. I would say sooner, but she is 85 years old.”