Somalia's constituent assembly endorsed a draft constitution Wednesday, billed as a key step to ending decades of civil war, and shortly after two suicide bombers blew themselves up at the gates.
"We are very happy today that you... responsibly completed the procedure by voting for the constitution," Prime Minister Abdiweli Mohamed Ali told the 825-strong assembly after it approved the draft by a landslide 96 percent.
"I announce that Somalia has from today left the transitional period."
The special assembly -- chosen by traditional elders in a UN-backed process -- took eight days to debate and vote on the new constitution for war-torn Somalia, as the graft-riddled government approaches the end of its mandate on August 20.
"This is an historic day -- today we have witnessed the completion of a task that has been worked on for the last eight years," said Abdirahman Hosh Jabril, Somalia's constitutional affairs minister.
"This morning around 645 members of the constituent assembly gathered, and fortunately 96% of the members have voted for the new provisional constitution."
Shortly before the vote, two suicide bombers blew themselves after they were stopped by security forces, killing only themselves.
"Security forces stopped their ambitions of attacking...they were shot and then they detonated their vests," Interior Minister Abisamad Moalim told reporters, adding that one security guard was wounded in the blast.
No group immediately claimed responsibility for the attack, which follows a string of explosions including roadside bombs and grenades that have rocked the Somali capital.
The provisional constitution applies immediately, but it must be finally ratified by a national referendum.
The complicated process is seen as a key step as the Transitional Federal Government (TFG) ends its mandate on August 20, after eight years of infighting and minimal political progress.
Somalia has been without a stable central government since the ouster of former president Siad Barre in 1991.
Mogadishu has seen a series of such attacks since the Shebab abandoned fixed positions there last year and switched to guerrilla tactics against the government, propped up by a 17,000-strong African Union force.
The Shebab face increasing pressure from pro-government forces and regional armies, having lost a series of key towns and strategic bases in recent months. However, experts warn they are far from defeated and remain a major threat.