A security official says a leading Libyan activist and vocal critic of the country's Islamists has been shot dead in a drive-by shooting in the city of Benghazi.

Security official Mohammed al-Hegazi said gunmen in a grey sedan stopped AbdulSalam al-Musmari on his way home after Friday prayers and shot him at close range.

Al-Hegazi said an investigation into the motives behind the attack and who committed the killing is under way.