Nearly 40,000 people in the United States died by guns last year, marking the highest number of gun deaths in decades, according to a new analysis of data from the Centers for Disease Control and Prevention's WONDER database.

A similar analysis was first conducted by the Educational Fund to Stop Gun Violence , a non-profit gun policy advocacy group.

CNN replicated that analysis and found that 39,773 people died by guns in 2017, which is an increase of more than 10,000 deaths from the 28,874 in 1999. The age-adjusted rate of firearm deaths per 100,000 people rose from 10.3 per 100,000 in 1999 to 12 per 100,000 in 2017.

CDC statisticians confirmed with CNN on Thursday that these numbers are correct and they show gun deaths have reached a record-high going back to at least 1979 , which was the year firearm deaths started to be coded in mortality data

CNN's analysis also showed that, within the total number of deaths, 23,854 people died from suicide by guns in 2017, the highest number in 18 years. That's a difference of more than 7,000 deaths compared with 16,599 suicide deaths by guns in 1999.

The age-adjusted rate of suicide deaths by firearm rose from 6.0 in 1999 to 6.9 in 2017.

Firearm deaths in the data include gun deaths by homicide and suicide, unintentional deaths, deaths in war or legal interventions, and deaths that are undetermined.

When the data are analyzed by race and gender, they show that white men made up 23,927 of the total 39,773 firearm deaths last year, including suicides.

In 2017, the age-adjusted rate of suicide deaths by firearm was highest among white men at 14 per 100,000 -- compared with:

2.2 among white women

6.1 among black men

0.7 among black women

3.0 among Asian men

0.5 among Asian women

9.3 among American Indian or Alaska Native men

1.4 among American Indian or Alaska Native women

That same year, the age-adjusted rate of homicide deaths by firearm was highest among black men at 33 per 100,000 -- compared with:

3.5 among white men

1.1 among white women

3.5 among black women

1.4 among Asian men

0.5 among Asian women

4.8 among American Indian or Alaska Native men

1.2 among American Indian or Alaska Native women

Also in 2017, the age-adjusted rate of firearm deaths in legal interventions or war was highest among American Indian or Alaska Native men at 1.1 per 100,000 -- compared with:

0.3 among white men

0.0 among white women

0.5 among black men

Rates for all other groups were either unreliable or not recorded

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

"In 2017, nearly 109 people died every single day from gun violence. Gun violence is a public health epidemic that requires a public health solution, which is why we must immediately enact and implement evidence-based interventions -- like permit-to-purchase policies and extreme risk laws," Adelyn Allchin, the director of public health research for the Educational Fund to Stop Gun Violence, said in a written statement released last week.

"Gun violence has been part of our day-to-day lives for far too long. It is way past time that elected leaders at every level of government work together to make gun violence rare and abnormal."