Armed men in Somalia have killed a veteran politician and his bodyguard in a drive-by shooting in the capital Mogadishu, police say.

Thursday's assassination of Mohamed Mohamud Heyd is the latest attack by suspected anti-government fighters who have pledged to step up violence during the Muslim holy month of Ramadan.

Al-Shabab, which frequently carries out deadly assaults in Mogadishu, claimed responsibility for the attack.

Experts say al-Shabab is increasingly targeting legislators at a time when the country's parliament is emerging as a pillar of democracy.

Heyd, his bodyguard, a parliamentary aide and another legislator were on their way to attend a parliamentary meeting in Mogadishu when their car was hit by a barrage of bullets, Captain Mohamed Hussein of the Somali police said.

The attack happened near the fortified presidential palace, considered one of the safest places in Mogadishu, Hussein said.

Heyd's aide and another legislator suffered bullet wounds, he said.

Abdiweli Sheikh Ahmed, Somalia's prime minister, condemned Heyd's killing, saying in a statement that such a "criminal act only promotes violence, distress and grief in our community".

Instant death

Heyd, a parliament member for the last 15 years, died instantly, Abdi Barre Yusuf, Heyd's fellow legislator, told Al Jazeera.

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

Heyd is the third legislator killed in attacks this year. He and another colleague survived an assassination attempt a month ago when a bomb was placed in their vehicle, Yusuf told Al Jazeera.

Al-Shabab fighters have previously carried out attacks against UN staff, government officials, African Union peacekeepers and last year on an upscale shopping mall in Nairobi, the capital of neighbouring Kenya, which has sent troops into Somalia to battle al-Shabab.

In other violent incidents on Thursday, fighters killed a Somali government soldier in Mogadishu's Medina district before escaping from scene.

And in the city's Dharkanley area, a tax collector was killed. At least eight security officials have been killed in Mogadishu over the past five days.

With additional reporting by Al Jazeera's Hamza Mohamed

Source: Al Jazeera and agencies