Somalia's constituent assembly on Wednesday endorsed a draft constitution billed as a key step to ending decades of civil war during a vote two suicide bombers failed to scupper.

The Horn of Africa country's outgoing government hailed the end of an eight-year interim period but the UN warned that the transition's next steps were being threatened by "spoilers" in Somalia's fractious political class.

"We are very happy today that you... responsibly completed the procedure by voting for the constitution," Prime Minister Abdiweli Mohamed Ali told the 645 members of 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, 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 up at the gates 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, many carried out by the Al-Qaeda linked Shebab.

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.

Key steps in the fragile political process remain, including a new parliament to be selected by traditional elders, with that parliament to subsequently elect a new president.

However, the UN Special Representative for Somalia Augustine Mahiga has warned that the political elite are wrecking the process to select their supporters to staff the new parliament as lawmakers.

"There have been disturbing reports of undue influence from aspiring politicians in current and former positions," Mahiga said, noting it included "exchange (of) and demands for favors, bribery and intimidation."

"We should not allow parliamentary seats to become commodities for sale or items for auction to the highest bidders at a time when we are seeking to reclaim the true stature of a dignified and respected Somali nation," he added.

A leaked UN report earlier this month accused the current government of "pervasive corruption" estimating as much as 70% of state revenues had been stolen or squandered.

Bowed down by repeated droughts and riven by over two decades of conflict, Somalia is torn between rival clans, Islamist insurgents and the government, which is propped up by a 17,000-strong African Union force.

Somalia has been without a stable central government since the ouster of former president Siad Barre in 1991.

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.

The provisional constitution applies immediately, but it must be finally ratified by a national referendum within the lifetime of the next parliament.

Sources indicated the endorsed draft remained unchanged from an initial proposal, which provides for federal republic with laws "compliant with the general principles of Sharia" or Islamic law, and a multi-party system with women "included in all national institutions."

[Somali woman image via Agence France-Presse]