Black men are half as likely to die at any given time if they're in prison than if they aren't, suggests a new study of North Carolina inmates.

The black prisoners seemed to be especially protected against alcohol- and drug-related deaths, as well as lethal accidents and certain chronic diseases.

But that pattern didn't hold for white men, who on the whole were slightly more likely to die in prison than outside, according to findings published in Annals of Epidemiology.

Researchers say it's not the first time a study has found lower death rates among certain groups of inmates — particularly disadvantaged people, who might get protection against violent injuries and murder.

"Ironically, prisons are often the only provider of medical care accessible by these underserved and vulnerable Americans," said Hung-En Sung of the John Jay College of Criminal Justice in New York.

"Typically, prison-based care is more comprehensive than what inmates have received prior to their admission," Sung, who wasn't involved in the new study, told Reuters Health by email.

The new study involved about 100,000 men between age 20 and 79 who were held in North Carolina prisons at some point between 1995 and 2005. Sixty percent of those men were black.

Researchers linked prison and state health records to determine which of the inmates died, and of what causes, during their prison stay. Then they compared those figures with expected deaths in men of the same age and race in the general population.

Less than one percent of men died during incarceration, and there was no difference between black and white inmates. But outside prison walls, blacks have a higher rate of death at any given age than whites.

"What's very sad about this is that if we are able to all of a sudden equalize or diminish these health inequalities that you see by race inside a place like prison, it should also be that in places like a poor neighborhood we should be able to diminish these sort of inequities," said Evelyn Patterson, who studies correctional facilities at Vanderbilt University in Nashville, Tennessee.

"If it can be done (in prison), then certainly it can happen outside of prison," Patterson, who wasn't linked to the new work, told Reuters Health.

As in the general population, cancer and heart and blood vessel diseases were the most common cause of death among inmates — accounting for more than half of deaths.

White prisoners died of cardiovascular diseases as often as expected and died of cancer slightly more often than non-prisoners.

Black inmates, by contrast, were between 30 and 40 percent less likely to die of those causes than those who weren't incarcerated. They were also less likely to die of diabetes, alcohol- and drug-related causes, airway diseases, accidents, suicide and murder than black men not in prison.

All told, their risk of death at any age was only half that of men living in the community.

For white men, the overall death rate was slightly higher — by about 12 percent — than in the general population, with some of that attributed to higher rates of death from infection, including HIV and hepatitis. When the researchers broke prisoners up by age, death rates were only higher for white prisoners age 50 and older.

"For some populations, being in prison likely provides benefits in regards to access to healthcare and life expectancy," said study author Dr. David Rosen, from the University of North Carolina at Chapel Hill.

But, he added in an email, "it's important to remember that there are many possible negative consequences of imprisonment — for example, broken relationships, loss of employment opportunities, and greater entrenchment in criminal activity — that are not reflected in our study findings but nevertheless have an important influence on prisoners' lives and their overall health."

For Rosen, one of the main messages from the study is the need to make the world outside of prison walls safer, and to make sure people living there have adequate access to healthcare.