"A car loaded with explosives was intercepted near the parliament and it went off. There are casualties but we don't have details so far," police official Mohamed Idle told AFP.
Police and witnesses at the scene said there were as many as four dead and many more wounded.
There was no immediate claim of responsibility, although Al-Qaeda-linked Shebab rebels have carried out frequent attacks against the parliament and other centres of Somalia's fragile, internationally-backed government.
Last month militants from the Shebab set off a car bomb at the gates of parliament and then stormed the building while MPs were meeting, in an attack that left several dead.
On Thursday Shebab claimed responsibility for shooting dead a lawmaker and his bodyguard, the latest in a surge of attacks in Mogadishu during Islam's holy month of Ramadan.