Fresh from the news that its Apple Watch has helped the Cupertino company oust Fitbit as the world’s top wearables vendor, a new study suggests the device could have an unexpected use: Detecting abnormal heart rhythms.

A study by researchers from the University of San Francisco presented at Heart Rhythm 2017 reveals that the heart sensor built into the Apple Watch could be used to detect conditions like arrhythmia and atrial fibrillation (AF) with 97 percent accuracy.

Over the course of several months, the researchers gathered data from 6158 users of the Cardiogram app for the Apple Watch. 200 of the subjects had been diagnosed with paroxysmal atrial fibrillation. The engineers used the data to feed a deep neural network that learned to distinguish between a healthy heartbeat and AF.

The system was tested on 51 hospital patients set to undergo cardioversions, a procedure that restores the heart’s normal rhythm. By wearing the Watch and using the app for 20 minutes before and after the operations, it was found that the AI correctly detected AF 97 percent of the time.

“Our results show that common wearable trackers like smartwatches present a novel opportunity to monitor, capture and prompt medical therapy for atrial fibrillation without any active effort from patients,” Dr. Gregory Marcus, Director of Clinical Research at UCSF’s Division of Cardiology, said in a statement.

2.7 million Americans suffer from AF, according to the American Heart Association. It leads to blood clots, stroke, heart failure and other heart-related complications. With the illness being quite difficult to diagnose, wearables like the Apple Watch could help save lives.

“While mobile technology screening won’t replace more conventional monitoring methods, it has the potential to successfully screen those at an increased risk and lower the number of undiagnosed cases of AF,” Marcus added.