Demonstrators at Freddie Gray protest
Demonstrators confront law enforcement officers near Baltimore Police Department Western District Reuters

Mourners have gathered for the funeral of Freddie Gray, as the Baltimore Police Department report on a "credible threat" that gangs were planning to try to "take out" law enforcement officers.

The reported threat comes after Baltimore Mayor Stephanie Rawlings-Blake referred to a "small group of agitators" who smashed shop windows, looted merchandise and vandalised at least five police cars during protests on 25 April.

Three different gangs have reportedly agreed to join forces in an attempt to harm police. The Baltimore Police Department released a statement saying it had information the Black Guerrilla Family, Bloods and Crips would target law enforcement officers.

"Law enforcement agencies should take appropriate precautions to ensure the safety of their officers," police said in the statement.

The FBI office in Baltimore distributed a December memo advising that the Black Guerrilla Family gang was targeting "white cops" in Maryland to "send a message," an agency spokeswoman told the Baltimore Sun.

At the New Shiloh Baptist Church, thousands of people filed past to pay their respects to Freddie Gray who suffered a broken spine after being detained by officers.

The 25-year-old lay inside in a coffin, dressed in a white shirt, black trousers, white shoes and a Los Angeles Dodgers baseball cap. Inside the lid of the coffin was the quote, "Peace, Y'all".

A lawyer for Gray's family said at the funeral that the six officers suspended in the case should let the public know what happened.

Funeral of Freddie Gray
A mourner stands in front of the open casket of 25-year old Freddie Gray. Reuters

"This is our moment to get at truth. This is our moment to get it right," Bill Murphy said to a standing ovation."

"There's a lot of frustration, a lot of disappointment," added Joe Jones, head of the Centre for Urban Families.

President Barack Obama sent Broderick Johnson, the head of his initiative for minority males, to attend the service.

"We're in the midst of an epidemic of the killing of young black people across our country," Rev Jesse Jackson said at a news conference ahead of Mr Gray's funeral.

Baltimore police officials reported on Monday that rocks and other objects were thrown at officers who challenged groups of protesters outside a shopping mall in the Northwest section of the city.

Police tweeted that one officer was injured in an incident outside the Mondawmin Mall.

Television images showed dozens of police officers wearing helmets and riot gear as they lined up to confront small groups of teenagers.