FBI Director James B. Comey discusses race and law enforcement last month at Georgetown University in Washington. (Cliff Owen/AP)

Local police departments across the country are under increasing pressure to diversify their forces, particularly in light of a scathing Justice Department report about the mostly white Ferguson Police Department’s unfair treatment of African Americans.

That narrative has overshadowed another story about diversity in law enforcement: the FBI’s.

The FBI, which is part of the Justice Department, has long struggled with recruiting special agents of color into its ranks. Of the bureau’s 13,455 agents, only 606, or 4.5 percent, are African American, according to the most recently available statistics. Only 6.8 percent are Hispanic.

At the top levels of the FBI, only 5 percent of officials, most of whom came from the ranks of special agents, are African American. Only 2.8 percent are Hispanic.

For law enforcement agencies, the importance of diversity goes beyond statistics to the issue of connecting with minority communities, especially at a time of tension. In its report earlier this month, the Justice Department said the Ferguson department’s lack of diversity had been a contributing factor to undermining community trust.

The bureau’s director, James B. Comey, who is scheduled to address the National Organization of Black Law Enforcement Executives on Friday, has lamented the disconnect between law enforcement agencies and communities of color.

In a speech last month on race, he didn’t address diversity in the bureau’s workforce. Yet when he was asked about it afterward by a student, his response was blunt: “Big challenge for the FBI. The FBI is overwhelmingly white and male. . . . And I’ve got nothing against white males: I happen to be one.”

The FBI says it is actively recruiting minority candidates from 45 professional organizations and 49 colleges and universities, including historically black schools. But some African American law enforcement officials outside the bureau say it has historically gone about recruiting minorities in the wrong way.

“We recognize the challenges and the obstacles that law enforcement agencies face in trying to diversify,” said Malik Aziz, the national chairman of the National Black Police Association. “But the pool of qualified candidates of color is there.”

“The FBI tends to look more at candidates who are not coming from traditional law enforcement — when we have an estimated 110,000 black police offices in the country,” Aziz said. “Instead of focusing recruitment on individuals who have completed college and are looking for specific jobs in the FBI, the FBI should look at the many police departments who have shown a great commitment to law enforcement,” he said.

For years, the FBI has been trying to attract more minorities, and even critics acknowledge it has come a long way since the era of open racial bias when white agents wouldn’t hesitate before harassing black colleagues. That legacy of discrimination faded only after a series of widely publicized cases that prompted legal action and embarrassed the bureau.

In one of the more infamous cases, in the early 1980s, Donald Rochon, a black agent in the FBI’s Omaha office, successfully sued after repeated harassment, including one instance in which he found the picture of an ape’s head pasted over a photograph of his son. When he complained, he was transferred to another field office.

In a long-running class-action lawsuit filed in 1991, a group of hundreds of African American agents charged the FBI with racial discrimination in recruiting, promotions and the handling of the agents’ complaints. They reached a settlement with the bureau in 2001.

Nancy Savage, the executive director of the Society of Former Special Agents of the FBI, said the disproportionately small number of minorities in the bureau does not reflect an “institutional” bias.

“Historically,” Savage said, “there were some prejudicial practices. But I haven’t seen that for a long time.”

Officials say one of the biggest challenges in diversifying the force is the competition for talent — particularly in high-demand fields like cyber, a growing focus for the FBI.

The bureau requires candidates to have a college degree and to have worked for a few years before entering the force. But by that time, many potential minority candidates have been hired by private firms. The average age of incoming agents is 29.

That’s a point Comey made when responding to another student’s question after his speech last month at Georgetown University.

“If you’re as good as you probably are, because you go to school here, Coca-Cola is going to be after you, Microsoft is going to be after you, Apple is going to be after you, Exxon Mobil is going to be after you, and they’re going to throw all kinds of dough at you,” he said. “And then when you’re 29, you're thinking, ‘Yeah, not so much go work for the government.’ ”

“So, I’m trying to figure out how do I get people in earlier,” Comey said. “If I get my hooks in you before the private sector puts the gold handcuffs on people, I think I can change my numbers. Because I agree with the premise in your question. I have to change the numbers.”

Those numbers are disappointing to FBI officials in various ways. While the proportion of special agents who are African American or Hispanic are low, the percentages have also been in decline in recent years. Tiny slivers of the special agent population are made up of Asians (4.3 percent) or American Indian or Alaska Natives (0.39 percent.)

James Turgal, the assistant director of the human resources division of the FBI, said the bureau is working aggressively to improve the numbers — meeting with organizations including the National Urban League, the Congressional Black Caucus, the National Bar Association and the National Society of Hispanic MBAs.

“I’m trying everything I possibly can,” Turgal said, “to get minority candidates in the door.”

Julie Tate contributed to this report.