Nigeria's intelligence agency said it warned shopping complexes in Abuja for two weeks that Islamic extremists might attack them in the capital, where a blast at a mall killed 22 people this week.

The increased security may have prevented even more carnage, as witnesses said a security guard stopped a car bomber from entering the mall moments before the massive explosion on Wednesday.

Survivor Donald Chikason told ThisDay newspaper that a security guard argued with the driver of a car who wanted to enter Emab Plaza through the exit gate. When the guard refused, the man bent down and moments later the car exploded, Friday's edition of the newspaper quoted him as saying.

"The man started arguing, behaving as if he was drunk," it quoted him as saying.

Chikason, who works at a bank in the mall, was knocked out by the blast and only regained consciousness in the hospital.

The explosion, which was heard kilometres away, set 17 vehicles ablaze and shattered windows throughout the four-storey complex.

Body parts lay around the exit gate, other witnesses told The Associated Press. Dozens of wounded survivors were recovering in the hospitals Friday, most suffering burn wounds like Chikason, but at least one victim's leg had to be amputated, doctors said.

Nigerian intelligence received information that Boko Haram extremists were planning such an attack, said spokeswoman Marilyn Ogar of the Department of State Security.

"About two weeks ago we heard information that they were planning an attack at a busy shopping mall or market … and so we had to go from one shopping complex to another trying to tell people to be more aware," she told The Associated Press.

Emab Plaza is the biggest and busiest in Abuja, the nation's capital in central Nigeria. The explosion occurred around rush hour as many residents were hurrying to view Nigeria's Super Eagles match against Argentina at the World Cup in Brazil. It was unclear whether the bomb was timed to coincide with that, although Boko Haram has bombed several football viewing venues this year, prompting two northeastern states to ban public events to watch the football spectacular.

The state security department did not publish the intelligence about the threat to shopping malls, apparently to avoid a panic. Last week the government warned it had information that Boko Haram planned to hijack petrol tankers in the capital and booby trap them with explosives.

Also Friday, police said they defused a massive car bomb packed with 13 explosive devices outside the main mosque in Kano, Nigeria's second city, in the north of the country. "We detonated a dangerous device which could have pulled down buildings," police commissioner Aderenle Shinaba told reporters. "What happened in the Abuja explosion would have been child's play if these discovered explosives had exploded at the mosque."

He said it was timed to explode as people gathered for prayers on Friday, the main Muslim holy day.

Two separate bombs in Abuja in April killed about 120 people and wounded more than 200 at a busy bus station.

President Goodluck Jonathan visited the scene of the latest blast and victims in the hospital on Friday, after returning home hastily Thursday night and cutting short his participation at an African Union summit in Equatorial Guinea.

President visits hospital

Speaking to reporters at the main hospital, he sympathized with victims and their families and called the five-year-old Islamic uprising "one of the darkest phases in the history of our nation." Still he said he was confident "we shall surely pass through this" and promised the perpetrators would be brought to justice.

Jonathan and his government are making efforts to improve his image following international condemnation of his slow and ineffective response to the April mass abductions of more than 200 schoolgirls who still are held captive by Boko Haram extremists. Boko Haram also is blamed for the kidnappings of another 90 people this week.

Jonathan, a Christian, wrote that Boko Haram "seeks to overwhelm the country and impose its ideology on all Nigerians. My government is determined to make that impossible. We will not succumb to the will of terrorists."

Boko Haram's attacks have been concentrated in its stronghold in the northeast of the country but it has spread its attacks to the capital this year and increased the tempo and deadliness of attacks concentrated around bombings in cities and a scorched-earth policy in rural villages in the northeast.