(Adds quotes, details, edits) By Guled Mohamed MOGADISHU, May 17 (Reuters) - A roadside bomb targeted the Somali prime minister's convoy in Mogadishu on Thursday but no one was hurt, a day after four Ugandan peacekeepers died in a similar attack by rebels vowing an Iraq-style insurgency. Thursday's blast rocked a street near the former parliament building as Premier Ali Mohamed Gedi drove to the airport to see off a plane carrying the dead African Union (AU) soldiers home. "The bomb exploded away from the vehicle. One of two men suspected of planting the bomb was captured on the site," said government spokesman Abdullahi Muhyidin Mohamed. Another suspect fled and was being hunted, he said. It was at least the third attempt to kill Gedi, a former veterinary lecturer with no previous political experience, since he took office in late 2004. The government blames rebels from a militant Islamist group who have threatened an Iraq-style insurgency in the capital and have increasingly copied Iraqi guerrilla tactics -- including roadside bombs and targeted assassinations. Gedi's interim government and its Ethiopian allies, along with Washington, have accused the Islamists of links to al Qaeda, whose leader Osama bin Laden has encouraged jihadists to join the Somali insurgents. The interim government, backed by Ethiopian tanks, troops and warplanes, routed the Islamists from Mogadishu and southern Somalia in a quick war over the New Year. "BARBARIC ACT" After the blast, Gedi continued to the airport where Uganda's national anthem played as four coffins draped in black, red and gold Ugandan flags were loaded onto a cargo plane. He said Wednesday's attack on the peacekeepers was a "barbaric act" and that Somalis would never forget their Ugandan brothers who shed blood for the security of their country. "The soldiers who passed away were heroes," Gedi said. The Chairman of the AU Commission, Alpha Omar Konare, said he was shocked and deeply saddened by the deaths. "The Chairperson ... condemns in the strongest terms this despicable attack and expresses his condolences to the families of the bereaved and commiserates with those of the wounded," he said in a statement issued at the AU headquarters in Ethiopia. About 1,600 Ugandans are in Mogadishu as the vanguard of a proposed 8,000-strong AU force. Lack of funds, logistical problems and nerves over insecurity have so far stopped other African nations from fulfilling pledges, although the AU says Burundi, Ghana and Nigeria are all due to send soldiers in the coming weeks. This week's bombings shattered relative calm in the city since Gedi declared victory over the insurgents following two major battles in March and April that killed at least 1,300 people and levelled entire neighbourhoods. It was the worst fighting in Mogadishu since dictator Mohamed Siad Barre's 1991 ouster plunged Somalia into anarchy that it has yet to escape fully, and contributed to an exodus of at least 365,000 from the seaside capital since February. (Additional reporting by Ibrahim Mohamed)