A new study has found that married gay men in same sex marriages live longer, while mortality rates among married lesbians have begun to rise, despite a long period of decline.

6.5 million adults from 1982 to 2011 were followed from Denmark’s civil registry in the study, published on Tuesday in the International Journal of Epidemiology.

This study is the first of its kind of examine mortality and relationship status together, for an entire nation.

“Our study expands on century-old knowledge that married people generally have lower mortality than unmarried and divorced persons,” wrote the study’s lead author, Dr. Morten Frisch, a professor of epidemiology at Aalborg University. “From a public health viewpoint it is important to try and identify those underlying factors and mechanisms.”

Marriage itself did not, however, ensure lower mortality rates during the period of the study, as opposite-sex married couples living apart, faced a doubling of their mortality rate.

Same-sex civil unions have been legal in Denmark since 1989, and mortality rates have changed greatly for gay and lesbian people since then.

Across the time frame of the study, the mortality rate for married gay men fell drastically, and is now just lower than the mortality rate for unmarried or divorced straight men.

The study’s authors made a link to the decreasing mortality rate and the advances in treatment of HIV and AIDS.

Much to the surprise of researchers, however, the mortality rate for lesbian couples had increased after dropping for many years.

It found that the mortality rate for lesbian couples were now higher than married gay men and cohabiting straight couples.

“Lesbians may constitute a largely unnoticed high-risk population for suicide and breast cancer,” authors wrote.

The study found that straight married and divorced people had a higher mortality rate the more times they married. The rate increase 27% for women with each successive marriage and 16% for men.

The lowering of mortality rates for married couples were attributed to income, health care, increased social support and other factors. Straight, married couples had the lowest risk of death.

Because gay couples represented less than 1% of the study sample, the authors noted that it may be limited in its findings.

“Future studies of health patterns among homosexual persons will gain statistical power, and presumably be more representative of the target population,” researchers wrote.