Medical Daily is pleased to announce it will soon be part of Newsweek. There, you will find the same stories on the latest news about health, fitness, nutrition, and relationships to enhance your life.

The wonders of coffee are varied. Your morning cup has been thought to lower risks of certain diseases like Parkinson’s and diabetes, in addition to boosting metabolism. Now, a new study indicates that drinking coffee could also keep you living longer—if you’re a diabetic woman.

Scientists in Portugal presented this new research at the European Association for the Study of Diabetes Annual Meeting in Lisbon, Portugal, held September 11–15. The observational study included more than 3,000 people, all of whom had diabetes and used a diary to track coffee, tea and soft drink consumption, according to a release.

Related: Diabetes Vaccine Entering Human Testing Could Also Prevent The Common Cold

The findings revealed that females with diabetes who regularly drank caffeine, either from tea or coffee, lived longer than those who abstained from caffeinated beverages. Unfortunately for men, the study didn’t indicate any difference in their life span.

Women benefited from consuming caffeine regardless of the source of their buzz, but the type of health benefits varied depending on the beverage. Ladies who drank about one cup of coffee daily (roughly 100 mg) were 51 percent less likely to die from any cause compared to noncaffeinated participants. While moderation usually is key, that wasn’t the case in this study. When consumption was boosted to between 100 and 200 mg of coffee per day, women had a 57 percent lower chance of death. Drinking two cups of coffee daily lowered the risk to 66 percent.

Caffeinated tea drinkers had a reduced risk of dying from cancer, the study found. Females who drank the most tea reduced cancer-related deaths by 80 percent, compared to non–tea drinkers. However, the study authors warn that the sample of tea drinkers was very small and that the results should be considered a starting point for additional studies.

Related: Debunk Major Myths About Diabetes

Data for the study was taken from the United States’ National Health Nutrition Examination Survey from 1999 to 2010, which is supposed to represent the overall health of Americans.

Unlike other studies, this one focused on diabetic patients, but it is still one of many that analyzes the health benefits of caffeine. There are more than 1,000 pieces of research looking at coffee’s effect on cancer, according to the American Cancer Society. The National Cancer Institute estimates that more than 50 epidemiological studies have been published focusing on the link between tea and cancer, and the results have been inconsistent, though some indicate the beverage can reduce risk of colon, breast, ovary, prostate and lung cancers.

Of course, no one knows the secret to preventing cancer, but most health professionals agree about the best ways to lower your risk: Eat a healthy diet, exercise, wear sunscreen and don’t smoke.