Doctors found "no evidence of any remaining disease" and scans taken before the surgery showed no cancerous growths elsewhere in her body, the court said in a statement. No additional treatment is currently planned, it said.
The 85-year-old Ginsburg is the leader of the court's liberal wing. She has achieved an iconic status rare for Supreme Court justices and is known as the Notorious RBG to some of her most ardent fans. In recent days, Ginsburg has basked in the warm applause of audiences that turned out for screenings of a new feature film about her life.
Her health is closely watched by liberals and conservatives alike. If she were to step down now, President Donald Trump would choose her replacement, and further shift the Supreme Court in a more conservative direction.
The growths were found incidentally during tests Ginsburg had after she fractured ribs in a fall in her Supreme Court office on Nov. 7, the court said.
Doctors at Memorial Sloan Kettering Cancer Center in New York performed a procedure called a pulmonary lobectomy on Ginsburg. The growths they removed were determined to be malignant in an initial pathology evaluation, the court said, citing Ginsburg's thoracic surgeon, Dr. Valerie W. Rusch.
Ginsburg is expected to remain in the hospital for a few days, the court said.
"If she doesn't need anything but the surgery, it is a very good sign," said Dr. John Lazar, director of thoracic robotic surgery at MedStar Washington Hospital Center.
It's not uncommon to see slow-growing lung cancers in women in their 80s, and they tend to respond well to surgery and go on to die of something unrelated, he said.
"This is just luck" that the growths were found through those rib X-rays because accidentally discovered lung tumors tend to be early-stage when surgery works best, said Dr. Giuseppe Giaccone, an oncologist at Georgetown University's Lombardi Comprehensive Cancer Center.
While doctors will have to see the final pathology report to know exactly what kind of tumors Ginsburg had and how aggressive they were, her previous bouts with cancer were so long ago they're unlikely to be related, Giaccone said.
Both doctors said patients typically spend three or four days in the hospital after this type of operation.
It was unclear whether Ginsburg would be back on the bench when the court next meets on Jan. 7. She has never missed Supreme Court arguments in more than 25 years as a justice.
She told an audience in New York last week at a screening of the movie "On the Basis of Sex" that she was about to resume her now-famous workout routine.
Ginsburg had surgery for colorectal cancer in 1999 and pancreatic cancer 10 years later. Doctors found the growth on her pancreas in the course of routine screenings as a result of her first cancer.
Among other health problems, she also broke two ribs in a fall in 2012 and had a stent implanted to open a blocked artery in 2014. She was hospitalized after a bad reaction to medicine in 2009.
Appointed by President Bill Clinton in 1993, Ginsburg rebuffed suggestions from some liberals that she should step down in the first two years of President Barack Obama's second term when Democrats controlled the Senate and would have been likely to confirm her successor.
She already has hired clerks for the term that extends into 2020, indicating she has no plans to retire.