The number of hate groups in the U.S. has reached an all-time high, even as membership in the Ku Klux Klan and neo-Nazi outfits have fallen, according to a report by a legal advocacy organization that tracks them.

The Southern Poverty Law Center's annual "Year in Hate and Extremism" report counted 1,020 hate groups in the nation, an increase of 7 percent from the 954 tallied in 2017.

The previous record for hate groups in the country was in 2011, when 1,018 were counted at the "height of a backlash" against the first black president of the U.S., Barack Obama, said Heidi Beirich, director of intelligence for the Southern Poverty Law Center.

Police tape is viewed around the area, Oct. 28, 2018, outside the Tree of Life Synagogue after a fatal shooting in Pittsburgh, Oct. 27, 2018.(Brendan Smialowski/AFP/Getty Images) Police tape is viewed around the area, Oct. 28, 2018, outside the Tree of Life Synagogue after a fatal shooting in Pittsburgh, Oct. 27, 2018.

This year's report showed that the number of hate groups has grown for four straight years.

"This time period dovetails with [Donald] Trump's campaign and then his presidency, a period that has seen a 30 percent increase in the number of these groups," Beirich said.

Local and federal authorities remove a suspicious package found at a US postal facility in Wilmington, Del., Oct. 25, 2018. A law enforcement official said suspicious packages addressed to former Vice President Joe Biden  were intercepted at Delaware mail facilities in New Castle and Wilmington and were similar to crude pipe bombs sent to former President Barack Obama, Hillary Clinton and CNN.(David Swanson/The Philadelphia Inquirer via AP) Local and federal authorities remove a suspicious package found at a US postal facility in Wilmington, Del., Oct. 25, 2018. A law enforcement official said suspicious packages addressed to former Vice President Joe Biden were intercepted at Delaware mail facilities in New Castle and Wilmington and were similar to crude pipe bombs sent to former President Barack Obama, Hillary Clinton and CNN.

The Southern Poverty Law Center defines a hate group as an organization that in its principles or statements from its leaders attacks or maligns an entire class of people typically for their race, religion, ethnicity, sexual orientation or gender identity.

Several groups on the list have blasted the organization for political bias and exaggerating the threat of hate. Some organizations have also sued to have the hate-group label removed. In 2018, the SPLC publicly apologized and paid out $3.4 million to political activist Maajid Nawaz for including him on its anti-Muslim extremist list in 2016.

California, the country's most populous and solidly Democratic state, had the most hate groups with 83; followed by Florida with 75 and 73 in Texas, according to the report.

The report also showed the number of white nationalist groups climbed 48 percent from 100 in 2017 to 148 in 2018.

"These are basically racists who wear suits, khakis, and polos who argue for a white ethnostate, a white political space controlled by whites," Beirich said.

She said the number of black nationalists groups also jumped 13 percent from 233 in 2017 to 264 in 2018.

"These are groups that are typically anti-Semitic, anti-LGBT and anti-white. They are very different than some of the white hate groups that we talk about often and track since they have virtually no supporters or influence in mainstream politics, much less the White House," Beirich said of the black nationalist groups.

The center's report also found that for the third straight year, the number of Ku Klux Klan groups fell from 130 in 2016 to 51 in 2018, and the number of neo-Nazi groups fell 7 percent from 121 in 2017 to 112 in 2018.

"The Klan has begun to be a part of the white supremacist movement that just isn't attracting many folks to its message," Beirich said. "It's simply becoming less important, which is a big change."

The report shows as the number of hate groups has risen, so has the number of hate crimes.

The FBI shows the number of hate crime incidents reported increased about 17 percent in 2017 compared with previous year.

Gregory Bush is led into a courtroom for an arraignment on murder charges in Louisville, Ky., on Friday, Nov. 2, 2018.(Dylan Lovan/AP) Gregory Bush is led into a courtroom for an arraignment on murder charges in Louisville, Ky., on Friday, Nov. 2, 2018.

She pointed to a two-week period around the midterm elections in November when the country saw suspects professing to be white supremacists go on shooting rampages.

On Oct. 27, Robert Bowers, 46 -- who authorities said "made statements regarding genocide and his desire to kill Jewish people" -- shot and killed 11 people at the Tree of Life Synagogue in Pittsburgh. Bowers is believed to have posted his intent to commit the massacre on the social media platform Gab, which is popular with white supremacists and the alt-right, investigators said.

On Oct. 26, Cesar Sayoc, 56, was arrested on charges of mailing more than a dozen pipe bombs to prominent Democrats, other high-profile liberal figures and CNN. Sayoc called himself a white supremacist and was found in a van plastered with pro-Trump stickers, investigators said. He has pleaded not guilty to charges.

On Oct. 24, Gregory Bush, 51, allegedly shot and killed two African-Americans at a Kroger market in Louisville, Kentucky. A grand jury charged him with murder and hate crimes because he allegedly targeted his victims based on their race, prosecutors said. Bush pleaded not guilty to the charges.

Beirich said a total of 40 people were killed in hate crimes in the U.S. and Canada in 2018.