A Somali MP has been killed and another injured when gunmen from the armed group al-Shabab opened fire on their vehicle in the Somali capital, Mogadishu.

Mohamed Mohamud, an MP for the last 15 years, died instantly in the attack on Thursday, fellow MP Abdi Barre Yusuf told Al Jazeera. Abdullah Ahmed, another MP and the secretary of parliament, suffered injuries in the attack.

"They blocked his car before spraying it with bullets, killing him and his bodyguard and injuring a secretary of the parliament." Yusuf said.

A spokesman for al-Qaeda-linked group fighting Somalia's UN-backed government said it carried out the attack.

The Somali prime minister, Abdiweli Sheikh Ahmed condemned the assassination.

"This criminal act only promotes violence, distress and grief in our community. Taking a human life is abhorrent and only affects an innocent family and strikes them with grief. This criminal act will be investigated and justice will be brought forth," Ahmed said in a statement.

Mohamud and another colleague survived an assassination attempt a month ago when a bomb was placed in their vehicle, Yusuf told Al Jazeera. In April the rebel group killed two MPs and wounded another in two separate incidents in the city.

In another developments, gunmen killed a Somali government soldier in Medina district of the city before escaping the scene. A tax collector was also killed in Dharkanley part of the city. At least eight security officials have been killed in the city in the past five days.

Source: Al Jazeera