Image copyright AP Image caption Mr Obama met community activists, police representatives and mayors

President Barack Obama has said the US is "not even close" to where it needs to be in bridging the divide between police and the communities they serve.

He said more must be done to build trust among black and Hispanic people that police violence would be investigated properly.

Mr Obama was speaking in Washington after meeting activists, politicians and law enforcement officers.

It follows recent killings of black men by officers in Louisiana and Minnesota.

The killings triggered a revenge attack by a black army veteran who shot dead five police officers in the city of Dallas last week.

Dallas shootings: Who were the victims?

Who was the attacker?

Special report: US racial divide

"We're going to have to do more work together in thinking about how we can build confidence that after police officers have used force, particularly deadly force, that there is confidence in how the investigation takes place and that justice is done," Mr Obama said.

Image copyright EPA Image caption The slain officers were honoured this week in a vigil and a memorial service

He suggested a set of practices may have to be established to ensure investigations are effective and fair.

"What's been apparent is that it's not enough just for us to have a task force, a report and then follow up through our departments.

"We have to push this out to communities so that they feel ownership for some of the good ideas that have been floating around this table," the president said.

On Tuesday, Mr Obama attended a memorial service in Dallas for the five killed officers and spoke to the families of the men killed by police in Louisiana and Minnesota, Alton Sterling, 37, and Philando Castile, 32, to offer condolences.

A day later, funerals were held in the Dallas area for two of the five officers, Lorne Ahrens, 48, and Brent Thompson, 43.

Later on Thursday, the funerals will take place of a third officer, Michael Smith, and, in the cathedral of St Paul in Minnesota, of Mr Castile.