Already the go-to drug of choice for millions with Type 2 diabetes, metformin might also fight lung cancer if those patients have it as well, new research shows.

Metformin appears to help boost the benefits of immunotherapy drugs used to fight lung tumors, according to a team led by Dr. Sai Yendamuri. He directs thoracic surgery at Roswell Park Comprehensive Cancer Center in Buffalo, New York.

There was one big catch to the new finding.

“Our work shows that the anticancer effect of metformin is active only in the context of obesity,” Yendamuri said in a news release. “We observed longer recurrence-free survival in overweight patients who took metformin and underwent surgery.”

The study was published recently in the Journal of the National Cancer Institute.

Lung cancer is the leading cause of cancer death for Americans. Almost 235,000 new cases of the illness are diagnosed each year, and more than 125,000 people die from it annually, according to the American Cancer Society.

According to the researchers, prior data had suggested that metformin might have anti-cancer benefits, although clinical trials hadn’t been able to confirm this. Yendamuri theorized that could be because the benefit might only be occurring among obese patients.

The new study involved 511 lung cancer patients with a body mass index of 25 or higher (above the threshold for overweight/obesity), and 232 patients with a BMI of less than 25, not considered overweight.

All had non-small cell lung cancers, or NSCLC, the leading form of the disease, and all had surgery to remove a lung tumor.

A second group included 284 overweight and 184 nonoverweight patients with NSCLC who received a type of immunotherapy called an immune checkpoint inhibitor.

Yendamuri plans a clinical trial to test metformin’s potential for preventing lung cancer in overweight or obese people at high risk for the disease.

“Metformin has been used for 30 years and has a long record of safety — and it’s one of the most widely accessible and affordable drugs of any kind,” Yendamuri said. “If we can repurpose it to fight cancer, that’s very exciting.”