A car bomb killed five people and wounded several others outside parliament in Somalia's provincial capital Baidoa on Monday in an assassination attempt on President Abdullahi Yusuf.
Six attackers were killed in a gunbattle with Yusuf's bodyguards after the explosion, which took place as lawmakers approved a new cabinet, Foreign Minister Ismail Hurre Buba said.
"A car exploded when the president's convoy was passing on the way to his residence," Hurre told the agency. "It was an assassination attempt on the president."
Yusuf escaped unharmed, but Hurre said five people were killed in the blast he said bore the hallmarks of Al-Qaeda.
"It was characteristically an (Al) Qaeda-type attempt (with) a car being put next to other cars and an explosion taking place through remote control," he said.
However, Interior Minister Hussein Mohamed Farah Aideed said it was too soon to point the finger at any group. He added that security forces arrested two suspects.
The attack is sure to heighten tensions in the volatile nation of 10 million, between the internationally recognised but weak government and Islamists who control Mogadishu and a large swathe of southern Somalia.
An agency reporter at the scene saw black smoke billowing from burning cars close to the parliament building, which he said appeared to have dead bodies in them.
Government militiamen quickly cordoned off the area around the parliament building, a converted grain warehouse in the town 240 kms (150 miles) from the capital Mogadishu.
Scores of relatives thronged Baidoa's main hospital, where one casualty was admitted with his hand blown off.
Both Minister Hurre and Islamist spokesman Abdirahim Ali Mudey said Monday's violence was linked to the murder on Sunday of an Italian nun shot in Mogadishu.
"We think that the attempt in Baidoa is associated with the assassination of the Italian nun. Whoever was behind that is behind this," Hurre told a news conference in Nairobi.
But senior Islamist leader Sheikh Sharif Ahmed blamed foreign interference, singling out Ethiopia, which witnesses and regional experts say has deployed troops to Somalia to protect the government in its second year of power.
"I accuse foreign sides, particularly Ethiopia because it seeks to send foreign troops (to Somalia) and wants to justify its position at the United Nations," Ahmed told al Jazeera.
"... there seems to be many conspiracies being made against this country," he added.
The Islamists and the government have held two rounds of talks in the Sudanese capital Khartoum, pledging to form a joint military force.
"It will jeopardize the peace process if it becomes very obvious that the Islamists are behind this terrorist act," Hurre said, adding that the government was still prepared to meet with "moderate elements" of the Islamic courts.
In July, Prime Minister Ali Mohamed Gedi said Al-Qaeda had training bases in Somalia and was intent on plunging the nation, without effective central rule since 1991, into further chaos.
Witnesses said the parliamentary session carried on as normal after the blast, with 174 lawmakers out of the 199 present approving the cabinet. Gedi had named new ministers after Yusuf declared the earlier cabinet ineffective and dissolved it on Aug 7.
The violence was the latest to target political figures. In July, gunmen shot dead a Somali minister in Baidoa. In 2005 Gedi survived two assassination attempts in Mogadishu and Jowhar.
Somalia descended into lawlessness in 1991 when warlords toppled military dictator Mohamed Siad Barre and the country's 14th attempt at central administration since the ouster has been stymied by infighting and the newly empowered Islamists.