Witnesses reported seeing thick black smoke billowing from the building in Nigeria's capital Abuja at around 11am (BST).
It is believed that the blast was so large that it destroyed a wing of the UN office. Dozens are feared dead.
Police confirmed the explosion on Friday but did not comment on the nature of the blast or whether there were any casualties.
"I can confirm there was an explosion at the U.N. building," a police spokesman in Abuja said.
"We have deployed our policemen and anti-bomb squad. We can't establish how many casualties (there are)."
The building is situated in the same neighbourhood as the US Embassy and other diplomatic posts in Nigeria's capital.
Police and the wounded thronged the three-story building as people began to search for victims. Witnesses reported seeing ambulances taking away victims.
A security source told Reuters: "A car rammed into the building and exploded. This is very likely the work of Boko Haram and, or, AQIM (al Qaeda in the Islamic Maghreb) and is a serious escalation in the security situation in Nigeria. This is the worst thing that could have happened."
Alessandra Vellucci, a spokeswoman for the UN office in Geneva, said the global body's offices in Abuja had been bombed.
Abuja was the scene of a car bomb at police headquarters in June.