WASHINGTON (Reuters) - The relationship between U.S. police and the communities they serve is like a struggling marriage in need of better communication, the mayor of Baltimore, a city rocked by anti-police rioting, said on Wednesday.

Stephanie Rawlings-Blake, who is also president of the U.S. Conference of Mayors, said in a speech to the group it was up to both cities and police to determine what kind of interactions they would have.

"For better or worse we are stuck together," she said. "It's up to us whether it's going to be a healthy relationship or an unhealthy relationship."

She added that she knows "people married for 20 years, and haven't talked in 10. It happens. We have to keep talking."

Rawlings-Blake drew criticism in the aftermath of rioting and arson sparked by the death of Freddie Gray, a black man who died in April from an injury suffered in police custody.

Six officers face trial in his death. The mayor, a Democrat, said last month she would not seek re-election next year.

Gray's death was among a series of police killings of black men that sparked protests across the United States over race and justice.

Rawlings-Blake said Baltimore had been a "powder keg," adding, "we had to deal with the issues that many people in the community thought was an uneven playing field, that police officers were held to a different standard after they had been caught in a crime."

Rawlings-Blake hosted a delegation of nearly 40 mayors in Baltimore over the weekend to begin crafting an agenda to present presidential candidates and Congress on urban policy issues. They include investing in infrastructure, work force training and clean energy.