Gen Nishino / Getty Images

Doctors can easily tell when someone is having a heart attack, but one thing they can’t do is predict an attack before it happens. Even patients who come in for stress tests and get a clean bill of health often end up back in the hospital with a heart attack just days later.

But researchers say that may soon change, thanks to a study that used a blood test to detect certain cells that are sloughed off from weakened blood vessel walls. The cells are called circulating endothelial cells (CECs) and they herald the first stages of a heart attack, according to Dr. Eric Topol, chief academic officer for Scripps Health and lead author of the study published in the journal Science Translational Medicine.

Heart experts currently believe that heart attacks start days before a clot actually forms and blocks the flow of blood to the heart, says Topol. The first stages of a heart attack involve a weakening or erosion of the blood vessel walls, which then attracts inflammatory cells that damage the endothelial cells lining the inside of the blood vessels. Eventually, under the immense inflammatory pressure, these cells undergo mutations and start to clump together before sloughing off to float around in the blood.

MORE: Heart Attack in Women; Different Symptoms, Higher Risk of Death

In the study, involving 50 patients who had a heart attack and 44 healthy controls, the heart attack patients had more than four times the concentration of CECs in their blood than the controls. The CECs in the heart patients also looked different from those in the healthy people, often appearing misshapen and large, with multiple nuclei.

Researchers first connected CECs to impending heart attacks back in 1999, but Topol’s work takes that early investigation further, with a more sophisticated way of identifying CECs in the blood. The current research is also the most in depth study to date of the structural changes that distinguish these cells. “For the first time, we can isolate these cells through techniques that were not available in 1999,” says Topol. “They are like a window into the process that underlies an imminent heart attack.”

The researchers were able to draw on work from the cancer field, where efforts to identify tumor cells that break off from growths and enter the bloodstream are helping to diagnose cancers earlier. Using specific proteins or cell markers that appear exclusively on the surface of blood vessel cells, Topol and his colleagues came up with a molecular profile for CECs that he hopes will form the basis of a more user-friendly test in coming years.

They are also in the process of doing extensive genetic tests on the cells in order to construct a dossier on its gene activity. Already, he says, they know that the cells are abnormal, and have more than one nucleus, compared to the single nucleus in normal cells. “These cells are sick,” he says. “They are very multinucleated, and have undergone many somatic mutations and have altered cell structure.”

MORE: Stem Cells Heal Scar Damage After Heart Attack

It’s also becoming clear that the CECs start sloughing off the vessel walls a few days to a week or so before fatty plaques rupture and form blood clots, causing a heart attack. That means that testing for CECs can help doctors predict who is on the verge of having an event. This could be especially helpful for the many patients who come into emergency rooms every day complaining of vague chest-tightening or tingling sensations, but show no signs of the elevated heart enzymes that would indicate a heart attack. These people are often sent home, only to come back several days later with a heart attack — and by that time it’s too late, the heart muscle may already be damaged. “It’s one of the most common misdiagnoses in American medicine,” says Topol, of the missed signs of heart attack.

If the test if validated, it might immediately be used to triage such patients, helping to predict who will have a heart attack in coming days and who is likely suffering from some other ailment, such as severe indigestion or heartburn. But ultimately, Topol hopes to see the technology embedded into a more permanent surveillance device that could keep track of CEC concentrations on a continuous basis. “In the long term, now that we have the molecular signature of the CECs, we could put it in a nanosensor that is embedded into a tiny vein in high risk people who are most vulnerable to having a heart attack, and have that sensor talk to their cell phone, so they get an alert that they might have a heart attack in a few days.”

That’s still a long ways away, but the results suggest that the more immediate benefit of checking for CECs might help thousands of people predict, and possibly avoid, their next heart attack.

MORE: Exercising Your DNA: How a Single Workout Can Change Gene Activity

Alice Park is a writer at TIME. Find her on Twitter at @aliceparkny. You can also continue the discussion on TIME’s Facebook page and on Twitter at @TIME.