FBI Director James B. Comey attends a Medal of Valor ceremony at the White House on May 16, 2016. (Drew Angerer/Getty Images)

FBI Director James B. Comey, speaking at the historic 16th Street Baptist Church here Wednesday, urged police and civilians to “open our hearts and our minds and see each other” more clearly.

“We still confront the status quo of separate lives,” he said, speaking from the same pulpit at which the Rev. Martin Luther King Jr. preached, urging non­violent resistance to segregation.

“It’s hard to hate up close,” he continued, as the congregation — black and white, police, civic leaders and church members — murmured in assent. “It’s hard to hate someone you know, someone whose life you begin to understand.”

White supremacists bombed the church in 1963, killing four black girls, in one of the defining moments of the civil rights struggle. Birmingham, where police once trained fire hoses and set dogs on peacefully protesting children, now has a black mayor and a black police chief.

Church member Cleopatra Ken­nedy, 73, marched with King, singing freedom songs and carrying a sign that said “Freedom Now.” She went to jail twice, for a total of 14 days, said Kennedy, a member of the choir, which sang rousing gospel songs before Comey spoke.

“There’s a miraculous change from what it was at the time,” she said. “But we still deal with some prejudice. There’s still work to be done.”

Comey said that racism and discrimination persist in the country and that a rise in violent crime is plaguing communities of color. He spoke on the second day of a conference on civil rights and law enforcement sponsored by the Birmingham Civil Rights Institute.

The gathering comes in the wake of a series of fatal shootings by police officers of unarmed black men, including in Ferguson, Mo., and North Charleston, S.C., and a 12-year-old in Cleveland. The shootings prompted protests across the country and the formation of the Black Lives Matter movement.

Comey stood in the same church where King in May 1963 prayed with black youngsters before they marched in a peaceful protest that ended with the children — some as young as 6 — being assaulted by police, with many then spending several days in jail. To his left was the stained-glass window that remained intact during the September 1963 bombing — but for the face of Jesus, which was blown out.

In the audience was former U.S. attorney Douglas Jones, who reopened the case against two of the church bombers, Thomas Blanton and Bobby Cherry, leading to convictions on four counts of murder in 2001 and 2002.

Comey recalled that King’s “Letter From Birmingham Jail,” written from his cell in 1963, was one of the texts that most influenced him. “We are caught in an inescapable network of mutuality, tied in a single garment of destiny,” he quoted. “Whatever affects one directly affects all indirectly.” He also cited W.E.B. DuBois, the scholar and civil rights leader from the early 20th century, who decried “the ‘peculiar indifference’ of good people.”

Comey used those two ideas to deliver his message that police and civilians need to understand one another and confront hard truths about themselves. Law enforcement in this country “was often . . . the enforcers of the status quo, which was mighty rough on some folks — especially minority communities, immigrant communities, communities lacking power,” he said.

Citizens, too, he said, need to see what police see. “They need to feel an officer’s heart race as she walks up to a house on a domestic-violence call — not knowing what she might encounter on the other side of that door,” he said.

What troubles him, he said, is the seeming divergence of law enforcement and the communities police officers serve.

Comey also acknowledged the FBI’s checkered history during the civil rights era, in particular its covert monitoring and wiretapping of King, whom FBI Director J. Edgar Hoover suspected of communist influence. He noted that on his desk, he keeps a copy of an October 1963 memo from Hoover to Robert F. Kennedy, then the attorney general, asking for permission to bug King’s phone calls: “I keep it there in that spot to remind me of what we in the FBI are responsible for, and what we as humans are capable of, and why it is vital that power always be checked, overseen and constrained.”

He said it took the case of the 1964 murders of three civil rights workers — two white, one black — and the 1964 Civil Rights Act for the federal government to fully embrace civil rights. “We were late to the fight,” he said, “but as we regained trust, the community helped us prosecute more civil rights cases.”

Comey also noted that violence is rising in a number of cities.

Today, homicides are up in Birmingham, with last year being the deadliest year since 2008, he said. It is a trend also visible in Baltimore, Las Vegas, Dallas and Chicago. Some have attributed Birmingham’s rising murder rate to violence related to the drug trade and a high poverty rate. “But from city to city, we just don’t know what’s behind it,” Comey said, noting that in some places, the trend lines are down.

He called for better data on crime statistics, including on how many people were shot by police and in what circumstances. He said the FBI needs more people of color. Its special agent cadre is 83 percent white, he noted, as the country is growing more diverse.