The ongoing national debate over issues of race, accountability and community relations in law enforcement is happening at the same time many urban police departments — including those in Minneapolis and St. Paul — are hiring to replace waves of retiring baby boomers.

Those staffing decisions offer the opportunity for police departments to build stronger relationships with the communities they serve. With that in mind, residents of Minneapolis and St. Paul should be encouraged by the efforts of police officials to diversify their ranks and keep the lines of communication open with citizens through regular meetings, youth outreach and improved community policing.

Last month, for example, the St. Paul Police Department hired its first Karen officer, an Asian immigrant from Myanmar. He’s part of the largest — and most diverse — incoming class of St. Paul officers in at least 30 years. Forty-seven officers joined the force in December, including 15 military veterans, nine Asians, five women, three African-Americans and one Latino. The class swells the ranks of the department to 615 sworn officers, the most in the city’s history.

In late November, 24 officers were added to the roster in Minneapolis, leaving the department with 823 rank-and-file officers. A cadet class of 20 to 30 recruits is expected to be hired in March, while another 20 to 30 are expected to come on board in September.

Minneapolis officials have expressed a commitment to diversity, but they must be held accountable. Records show that even after years of legal action and federal mediation, the numbers of black and Hispanic officers in the department still don’t reflect the city’s racial makeup.

Police officials say it’s difficult to recruit new officers of color, particularly from black and other communities that feel they’ve been mistreated by cops. A Police Department spokesman said Minneapolis also has lost some good candidates to other departments.

Improved police-community relations in communities of color should make recruiting more fruitful, and both departments should benefit from youth programs and “grow your own” initiatives to attract young people to careers in law enforcement.

It’s also critical for police departments to continue to improve candidate screening based on temperament. Law enforcement is a special kind of public service. It takes a certain set of personal, professional and people skills to do it well.

The majority of officers are dedicated, responsible public servants who put their lives on the line simply by putting on a uniform, as we were reminded again recently when two officers were ambushed in New York.

But along with the deaths of young black men in Ferguson, Mo., and New York, that attack has made it even more urgent for city officials and police leaders in the Twin Cities and across the country to diversify their ranks with qualified officers who reflect the communities they serve.