Somalia's Shabab insurgents assassinated a lawmaker and his guards, the president said late Saturday, hours after U.S. President Barack Obama said the Al-Qaeda affiliated militants had been "weakened." Gunmen sprayed the car of MP Abdulahi Hussein Mohamud with gunfire as he travelled through a southern district of the capital Mogadishu earlier Saturday, killing him, his two guards and the driver. President Hassan Sheikh Mohammad said he was "devastated" at the attack, the latest in a string of murders of Somalia's lawmakers. "The lawmaker was martyred while serving the nation, but such killings will not deter us from going forward," Mohammad told reporters. The Shabab said in a statement that their "mujahedeen fighters targeted and killed a member of the parliament and his guards," adding that they "will continue targeting" lawmakers. The Shabab have carried out repeated attacks including a campaign of suicide attacks and assassinations targeting government figures. UN envoy to Somalia Nicholas Kay called the murders a "despicable act." Witnesses said the militants fled after the attack. "They opened fire on the car of the lawmaker and all of the passengers including him died," witness Abdirahman Mire said. The Shabab is fighting to overthrow Somalia's Western-backed government which is propped up and protected by the 22,000-strong African Union force (AMISOM). The attack came as Obama, on a visit to neighboring Kenya, praised AMISOM's efforts, but said while the insurgents had been "weakened," the overall security threat posed by the group remained. "We have been able to decrease their effective control within Somalia and have weakened those networks operating here in East Africa. That doesn't mean the problem is solved," Obama said. "We can degrade significantly the capacity of the terrorist organizations, but they can still do damage," he added. Somali government troops backed by African Union forces last week launched "Operation Jubba Corridor" - an offensive it said was aimed at flushing the insurgents out of rural areas in southern Somalia in an operation involving Ethiopian and Kenyan forces. Deployed to Somalia since 2007, AMISOM has helped push back Shabab across much of the country's south, retaking towns and territory the group had held for years. U.S. drone strikes have also taken their toll on Shabab, killing senior commanders, including the group's leader Ahmed Godane in September. On Saturday, there were reports of helicopters - believed to be from Ethiopia - carrying out airstrikes targeting Shabab fighters in the southern Bay region. Government officials said the attacks had killed several Shabab fighters, but residents said civilians had also been killed. "Al-Shabab are defeated, and they are forcing the civilians to flee with them in order to use them as human shields," said local government official Abdirahman Mohammad, adding he had no reports of civilian deaths. But residents around the forests of Dolondole said a truck carrying civilians fleeing the fighting had been blown up. "A missile struck a truck and six civilians including two children died, I saw seven others who were seriously wounded," said local resident Mohammad Sheikh Mumin. Other witnesses said civilians had been killed. The deaths Saturday follow witness reports earlier in the week in the southern Bakool region of dozens of civilians killed.