Blood pressure medication may confer a larger benefit if taken at night, rather than in the morning, according to research published Tuesday in the European Heart Journal.

The large study of more than 19,000 high blood pressure patients found that taking the medication so that it works overnight, when patients are asleep, cuts the risk of heart-related death and disease nearly in half.

"The same medication ingested at different times of the day actually has different pharmacological properties, behaving like totally different medications," said the study's lead author, Ramón Hermida, director of the Bioengineering and Chronobiology Labs at the University of Vigo in Spain.

Hermida and his research team randomly selected half of the study participants to take their blood pressure pills upon waking up in the morning. The other half made the medication part of their bedtime routine.

The team then tracked the patients for six years, periodically monitoring their blood pressure levels continuously in 48-hour blocks.

The differences in outcomes were striking: Compared with the group who took their pills in the morning, the nighttimers had a more than 40 percent lower risk of experiencing a heart attack, heart failure, stroke or needing procedures to open clogged coronary arteries.

What's more, their risk of dying from heart problems during the study period was cut by 56 percent.

By taking your blood pressure medications before going to bed, you're preventing high blood pressure during sleep, which is a significant risk factor for cardiovascular disease, Hermida told NBC News.

Normally, a person experiences "nocturnal dipping" while asleep at night: Blood pressure "dips" by about 10 to 20 percent.

But that doesn't happen in some people, and others may even experience an increase in blood pressure during sleep, said Dr. Luke Laffin, a preventive cardiologist at the Cleveland Clinic who was not involved in the new research.

"It makes sense that if we give blood pressure medicines at night, we may catch some of those people who have the nondipping patterns, or elevated blood pressures at night," said Laffin, "and protect them from more cardiovascular disease."

Previous studies had hinted that better blood pressure control at night might offer a benefit.

"This was the piece that was missing," Dr. Renato Lopes, a professor of medicine at Duke University School of Medicine, said.

"For the first time in a very large, randomized fashion, this study really gave us impressive results," said Lopes, who was not involved in the new research.

While the results are encouraging, researchers say patients with high blood pressure should speak with their doctors before making any changes to their blood pressure medication routines.

"It is important to understand that this may not apply to medications that need to be taken more than once a day, or for blood pressure medications that are being prescribed for other problems such as angina," Dr. Tim Chico, professor of cardiovascular medicine at the University of Sheffield in the U.K., said in a statement.

And there are other caveats.

The new research had participants take all of their blood pressure medications at once, either at night or in the morning, rather some in the morning or some at night. But some cardiologists say many patients may need a more tailored approach.

"For most people, a combination of a couple medicines in the morning and a couple in the evening means you're going to do better, eliminate side effects and generally have better control of your blood pressureover 24 hours," Laffin said.

And people may not want to take certain kinds of blood pressure medications at night, such as diuretics, because they increase urination.

The study included only white participants, so it's unclear whether the apparent benefits would be as effective for African Americans, who have consistently higher uncontrolled blood pressure and heart disease death rates.

The findings also may not apply to people who are awake all night, such as shift workers.

Meanwhile, simply making sure to take your blood pressure medications overall has shown to reduce the risk of heart attack and stroke significantly. Anyone with a measurement over 130/80 mmHg is considered to have high blood pressure, according to guidelines from the American Heart Association and the American College of Cardiology.

The time of day a person measures his or her blood pressure may also be key. Readings tend to be higher first thing in the morning, so many doctors recommend those keeping track of blood pressure at home take measurements once in the morning, and once in the evening.

CORRECTION (Oct. 23, 2019, 2:09 p.m. ET): An earlier version of this article misstated how much the risk of dying from heart problems was cut by taking blood pressure medication at night rather than in the morning. It is 56 percent, not 66 percent.

Follow NBC HEALTH on Twitter & Facebook.