You may grab a cup (or two) of coffee every morning to help you wake up and face the day, but you may also be doing your skin a favor. Researchers in a new paper released January 20 say that coffee can protect against melanoma, the deadliest form of skin cancer.

Melanoma is triggered by damage to skin cells’ DNA caused by UV rays from the sun or tanning beds; these mutations prompt the cells to grow abnormally and spread to other tissues in the body, where it can be fatal. But in a report published in the Journal of the National Cancer Institute, Erikka Loftfield from the National Cancer Institute and her colleagues found that people who drank more than four cups of coffee a day on average had a 20% lower risk of developing melanoma over 10 years.

Loftfield’s group looked at food and cancer information from more than 447,000 people enrolled in a National Institutes of Health-AARP study who answered a 124-item food questionnaire and allowed the scientists access to their medical records. Even after the team adjusted for the potential effects of age, smoking, alcohol use and family history of cancer, the connection between high coffee consumption and lower risk of melanoma remained significant. The researchers even factored in the potential effect of casual sun exposure by looking at the average July ultraviolet readings where the participants lived.

The association only held for caffeinated coffee—not for decaf—and Loftfield’s group says there’s sound biological reason for that. Coffee contains numerous compounds, including polyphenols and caffeine, that keep cancer-fighting processes that are triggered by UV light under control. The roasting process of coffee beans also releases vitamin derivatives that protect against UV damage in mice. There’s also intriguing evidence that caffeine may act as a molecular sunscreen, absorbing UV rays and therefore protecting DNA from damage.

The group says that their results need to be repeated and confirmed, and that it’s too early yet to change your coffee habits to protect yourself from skin cancer. But the findings support the idea that there might be more you can do to protect yourself from the sun’s harmful rays than only slathering your body in sunscreen. It’s okay to enjoy a few cups of joe (as long as it’s in the shade).

Read next: This Kind of Tea Lowers Blood Pressure Naturally

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Listen to the most important stories of the day.

Contact us at letters@time.com.