Chicago has seen an onslaught of violent crimes because the Illinois city, much like the rest of the country, has allowed politics to dictate policy, leaving law enforcement “demoralized” and under attack even amid weeks of bloodshed, a former police chief told Fox News.

Former Police Superintendent Garry McCarthy said Chicago's recent uptick in violence, combined with the tense relations between police and the public, has “been building for a while” as the culture in the city and the nation began to change even years ago.

"The fact is, and we need to pay attention to this, crime reduction isn't a turn on a light switch and it happens," he told Fox News on Tuesday. "Chicago, unfortunately, is unwilling to stay the course."

CHICAGO PASTOR REACTS TO WEEKEND VIOLENCE, DEATH OF 7-YEAR-OLD: 'WE HAVE TO TAKE BACK OUR CITIES'

McCarthy spent decades with the New York Police Department, including a stint as the NYPD's chief of crime control strategies, which oversaw the city’s crime trends. He was at the helm of the Chicago Police Department from 2011 to 2015.

Police work the scene where a 19-year-old man was shot in the 400 block of West 77th Street in Chicago on July 3, 2020. (Armando L. Sanchez/Chicago Tribune/Tribune News Service via Getty Images)

“My third and fourth years as [Chicago Police] superintendent, we had the lowest murder rates in 50 years in this city. And then things started to change and politics started dictating policy nationally with the Michael Brown incident in Ferguson. And the next thing you know, we did an about-face," McCarthy continued. “Basically, we stopped doing the things that we know worked."

He said police departments, such as CPD, know how to combat crime, but are limited in what they can do.

“There's no mystery to this,” he said. “We know how to do this. But the politics, certainly here in Chicago, and in other places across the country, refuses to allow those things to actually happen. And cultural change is not an easy thing to do.”

DHS SEC. CHAD WOLF: CRIMINALS ARE 'EMBOLDENED' AS LEADERS 'PLAY POLITICS' WITH LAW ENFORCEMENT

In McCarthy’s first full year on the job, the number of homicides in Chicago climbed past the 500-mark. The total fell the next year and never reached 500 again during McCarthy’s tenure. After he left, the number climbed, including in 2016 when it skyrocketed to 762.

Chicago has counted 1,782 shooting victims this year, 550 more than during the same period last year.

During the holiday weekend alone, 17 people were fatally shot, including a 7-year-old girl and a 14-year-old boy, and 70 more wounded. The weekend brought the number of homicides for 2020 to 353, which is 99 more than were recorded for the same period last year.

It also follows Chicago's deadliest Memorial Day weekend since 2015.

In all, 13 children under the age of 18 were shot, including the two that died,  from 6 p.m. Thursday through the end of Sunday. Police statistics show there have been 32 homicide victims under the age of 18 this year compared to 20 by this point in 2019.

Chicago Police Department officers look on as protesters gather outside their precinct on June 19, 2020 in Chicago, Illinois. (Natasha Moustache/Getty Images)

McCarthy stressed that law enforcement is "under attack" and people aren’t being fairly held accountable amid the police brutality protests that have sprouted nationwide.

"Now, we have a demoralized workforce because the police are absolutely under attack across the country. And it's no different anyplace else. It's happening in New York. It's happening in Los Angeles, Atlanta, Houston, you name it," he said. “Here in Chicago, the police are under attack. You have riots. And it's not the rioters who are being held accountable. It's the police for their response to it.”

The violence in Chicago and New York caught the attention of President Donald Trump, who tweeted: “The federal government ready, willing and able to help, if asked.”

McCarthy was terminated from his position in 2015 by then-Mayor Rahm Emanuel, as an effort to restore public confidence in the police force and his administration. His firing was announced just days after the court-ordered release of the video showing White police officer Jason Van Dyke shooting Laquan McDonald, a Black teenager, 16 times.

CLICK HERE FOR THE FOX NEWS APP

McCarthy said he had opposed releasing the video of the shooting until the investigation was complete.

He later led his own bid for Chicago mayor, though unsuccessful, in the February 2019 election.

The Associated Press contributed to this report.