Rioters looted stores and pelted police with rocks in Baltimore on Monday after the funeral of an African American man whose death in custody has reignited outrage over US police conduct towards blacks.

Maryland Governor Larry Hogan declared a state of emergency in the port city of 620,000 and activated the National Guard as rioters prowled in small groups, ransacking shops and trashing police vehicles. Other cars were set on fire.

At least seven officers were injured in the violence, and police said one was "unresponsive."

Local and state police in riot gear struggled to restore order as the rioters veered off in different directions, refusing to heed dispersal orders.

"We have seven officers injured during the course of this. They have broken bones; one is unresponsive," Baltimore police spokesman Captain Eric Kowalczyk told reporters.

"You're going to see tear gas... We're going to use appropriate methods to ensure that we're able to preserve the safety of that community."

NBC affiliate WBAL reported there had been at least one arrest, and the Baltimore Orioles baseball team postponed its evening game against the Chicago White Sox.

'Absolutely inexcusable'

Rioting erupted soon after Gray was buried -- possibly spurred by a cryptic message on social media declaring an after-school "purge," which is street slang for random acts of lawlessness.

Fear of unrest prompted the University of Maryland's downtown campus, corporate offices and the city's famous Lexington Market to shut down early.

President Barack Obama was briefed on the rapidly evolving situation by his newly sworn in Attorney General Loretta Lynch and city mayor Stephanie Rawlings-Blake, the White House said.

Thousands had converged on New Shiloh Baptist church in Baltimore's poverty-ridden Sandtown neighborhood earlier Monday to pay final respects to Gray, who died on April 19 of severe spinal injuries apparently sustained during his arrest a week earlier.

His death was the latest in a string of high-profile confrontations between African Americans and police, including the fatal shooting of unarmed teenager Michael Brown by a white police officer in Ferguson, Missouri last year.

Gray's grieving family had explicitly asked for no protests.

"Today of all days, the family was clear this was a day of sacred closure," pastor Jamal Bryant of the city's Empowerment Temple mega-church, who delivered the eulogy, told reporters as the violence spiralled.

"So for us to come out of the burial and walk into this is absolutely inexcusable. I'm asking every young person to go back home."

Weekend unrest

On Saturday, 34 people were arrested, and six police officers injured, when violence erupted after an orderly rally for Gray outside Baltimore city hall.

In the hours before Monday's riots, police announced they had received a "credible threat" that criminal gangs in Baltimore had "entered into a partnership to 'take out' law enforcement officers."

At the funeral, Gray's body was in a white casket next to a Los Angeles Dodgers baseball cap and a sign reading "Peace y'all."

Crowds swayed to hymns at the service, chanting, "Justice shall prevail, peace will prevail" in the church, where a photo of Gray -- who had a record of petty drug offenses, in a grim part of Baltimore notorious for crime, poverty and joblessness -- was displayed among floral wreaths.

Supporters, many dressed in all white, filled the building's 2,200 seats and hundreds of others stood, with the words "Black lives matter and all lives matter" projected on the wall.

Civil rights activist Jesse Jackson denounced the "epidemic of murders in the country."

"We have become too violent, too full of hate," Jackson told reporters before the service. "We need training, employment, housing, access to health, a reconstruction project. Poverty is a weapon of mass destruction."

Tensions high

Tensions have been on the rise in Baltimore since Gray's death, which his family's lawyers say was caused when 80 percent of his spine was severed following his arrest.

Six officers have been suspended with pay pending the outcome of a police investigation that is to be submitted to state prosecutors by Friday.

The US Justice Department, which was already looking into Baltimore's use of force, has also opened its own civil rights probe.

Police confirmed Gray requested medical help and an inhaler after he was detained and acknowledged that he should have received medical attention sooner.

They also revealed that Gray, contrary to policy, was not buckled into his seat in a police van, which made at least three unexplained stops on its way to the city's Western District station, now the scene of nightly protests.

Gray's arrest was caught on video by bystanders, and he can be heard howling in apparent pain as his limp body is dragged into the van.