WARSAW—President Barack Obama said the availability of guns in the U.S. is fueling tensions between police officers and the communities they serve, even suggesting it contributed to the fatal shooting of an African-American man last week by law enforcement during a traffic stop in Minnesota.

Mr. Obama, speaking at a news conference Saturday after a summit in Poland, declined to ascribe a motive to the shooter who killed five police officers and wounded seven others Thursday night in Dallas during a protest against police brutality...