Amid increased tensions in the past two years between police and the communities they serve, U.S. President Barack Obama defended law enforcement officers during a speech in Chicago Tuesday while appealing to help find a solution to the rampant gun violence in America. Speaking at the International Association of Chiefs of Police's annual conference, Obama highlighted the challenges of policing, the importance of reforming America's criminal justice system, implementing tougher gun laws to reduce violence and investing in resources to make sure police officers have all they need to do their job. 

"Too often, law enforcement gets scapegoated for the broader failures of our society and criminal justice system," Obama said in the speech just one day after he spoke at criminal justice reform panel discussion in Washington, D.C. 

The “us versus them” mentality between police and communities that Obama said are often embellished by by cable news outlets and politicians who want attention should be rejected, as well, the president added.

“We've got to resist the false trap that says either there should be no accountability for police or every police officer is a suspect no matter what they can do,” Obama said. 

Many African-Americans and Latinos have said the justice system is often unfair against them, Obama said, acknowledging that there is some racial bias in the legal system that can many times be a lopsided impediment to minorities. In addition, Obama called for increased gun control, arguing that less police officers would die in the line of duty if it was harder for criminals to get guns. Speaking to families of police officers who died in the line of duty, Obama said preventing officer deaths has been a priority. 

"I can't honestly tell them the country has done everything we could to keep this from happening again, from seeing another officer shot down, from seeing another innocent bystander suffer from a gunshot wound, and that’s a travesty," Obama said.

According to an FBI report released last week, more police officers were killed in the line of duty as a result of criminal activity in 2014 than in 2013. About 51 Officers were killed in 2014 as a result of a criminal act, up from 2013’s 27 officers.

"Fewer gun safety laws don't mean more freedom, they mean more danger, certainly more danger to police, more fallen officers, they mean more grieving families, more Americans terrified that they or their loved ones could be next,” he continued.

Obama said he asked for more funding for police agencies across the country. Investing in everything from bulletproof vests to crime data collection can all help police do their job more effectively, he said. 

On Monday, police leaders at the conference called for expanded background checks to cover all gun purchases. The high rate of homicide in some American cities is partly caused by the high amount of guns on the market, they said, Reuters reported, and all agencies should have the same access to records for criminal and mental health backgrounds.

Currently, background checks apply to licensed gun dealers, but not to those guns bought from private parties or at gun shows. "This is a no-brainer, this is the simplest thing in the world," Chicago Police Superintendent Garry McCarthy said Monday, according to Reuters. "It troubles me all the time."

The number of Americans in favor of more gun restrictions is steadily increasing. Gallup released a report Monday that said 55 percent of people are in favor of more gun control, up six percentage points from the year before.

Chicago served as Obama’s backdrop Tuesday in a city he calls his hometown and one that has long dealt with mass gun violence. The city had seen 391 homicides this year as of Monday, as well as 2,500 instances of people being shot, according to the Chicago Tribune. Both these numbers were increases compared to the same time last year.

Lax gun laws in states surrounding Illinois are thought to play a large roll in how guns get on the streets. Of all the illegal guns confiscated by Chicago police between 2009 and 2013, 60 percent came from Indiana.

Obama’s Tuesday talk came at a time when many are questioning what to do in the face of the high amount of mass shootings in recent years. The shooting at Umpqua Community College in Roseburg, Oregon this month, in which gunman Chris Harper Mercer killed nine people before being shot by police, was the 294th mass shooting in the United States this year.

Obama’s talk also came days after FBI Director James Comey’s remark that crime has increased across the United States because of heightened scrutiny of police officers, sometimes known as the “Ferguson effect,” referencing the mass protest that happened in Ferguson, Missouri last year after the shooting of Michael Brown, an unarmed black teenager, by a white police officer. Comey indicated that law enforcement officials are less aggressive in their job because they are afraid they might be videotaped.

The White House has tried to distance itself from the remarks, saying police officers aren’t trying to shy away from doing their job, the Huffington Post reported. Comey has since said he doesn’t have evidence to back up his claims, but that they were rather based on “common sense.”

At a panel discussion in Washington, D.C., last Thursday, Obama said the United States justice system should make sure punishments fit the crime, and also said there should be alternatives to incarceration, such as drug treatment programs. Obama also defended the Black Lives Matter social justice movement, saying that it is wrong to paint the entire group as anti-police. He said in using the phrase “black lives matter,” the activists are trying to illustrate a problem specific to the African-American community.