Nigeria's military chief said a bomb had been planted to target people celebrating New Year's Eve.
The explosion happened in the Mammy market, where people often gather to eat and drink beer.
Air Marshal Oluseyi Petirin blamed ""devilish people"" but did not name any group or give a possible motive.
He also declined to give any casualty figures.
State TV has said 30 people were killed but this has not been confirmed.
Witnesses have told the BBC they saw body parts lying on the ground and injured people being carried away after the blast.
""People ran in different directions. There were scores of bodies - dead and wounded. They used army trucks to pack them away,"" a market regular called Eric said, reports the Reuters news agency.
The area has been sealed off.
A bomb blast tore through a beer garden at a Nigerian army barracks where revelers had gathered to celebrate New Year's Eve, causing casualties, witnesses said.
A local police spokesman said the blast occurred at about 7:30 p.m. Friday in Abuja, the capital of Africa's most populous nation.
No one immediately claimed responsibility for the explosion in this oil-rich nation, where bombings at other locations had killed dozens of people several days earlier.
"It's unfortunate that some people planted (a) bomb where people are relaxing because of the new year," Air Marshal Oluseyi Petirin told journalists. "Nobody has been able to give accurate figures (of casualties), but we have rescued some people."
Officials declined to comment further.
"The details are still scanty," police spokesman Jimoh Moshood said.
A local journalist at the scene told The Associated Press that soldiers carried injured people away, with one officer saying he feared there were fatalities.
In the minutes after the explosion, police and soldiers swarmed the area, blocking onlookers from entering the area. Later, an AP journalist saw police carrying out covered bodies and putting them in the back of police vehicles. Officers shouted at each other to keep the bodies covered and hidden from onlookers.
The base, called the Mogadishu Barracks, includes an area of market stalls and beer parlors referred to locally as a "mammy market." There, civilians and soldiers regularly gather for meals and drinks.
The blasts come days after a similar attack struck a nation that remains uneasily divided by faith. On Christmas Eve, three bombs exploded in the central Nigerian city of Jos, killing dozens of people. That area has seen more than 500 die in religious and ethnic violence this year alone.
Members of a radical Muslim sect also attacked two churches in the northern city of Maiduguri the same night, killing at least six people.
The sect, known locally as Boko Haram, later claimed responsibility for both attacks in an Internet message. Police say they are still investigating those attacks.
Boko Haram means "Western education is sacrilege" in the local Hausa language. Its members re-emerged recently after starting a July 2009 riot that led to a security crackdown that left 700 people dead.
The Christmas Eve killings in Jos and Maiduguri add to the tally of thousands who already have died in Nigeria in the last decade over religious and political tension. The bombings also come as the nation prepares for what could be a tumultuous presidential election in April.