Ms Bughaighis was killed hours after she had cast her vote in Libya's parliamentary elections.

A medical source at a Benghazi hospital confirmed she died of a gunshot wound to the head.

An eyewitness has said she was attacked by five armed men, four of whom were masked.

Analysis: Rana Jawad, BBC News, Tripoli

It is not just Salwa Bughaighis' family and friends who are mourning her but many across Libya.

In 2011, in the early days of the uprising against Col Gaddafi, she was one of the few who kept me up-to-date on the deadly crackdown on protestors.

She and other lawyers and activists braved the streets to protest against the heavy-handed response. She was most recently heavily involved in moves to set up a National Dialogue to discuss Libya's many problems.

As a civil and woman's rights activist, she would not mince her words - often speaking bluntly about the dangers posed by Islamist groups and the failures since Gaddafi was ousted. As a lawyer, she frequently spoke of the urgent need for the rule of law.

Those who knew her and worked with her have also been reflecting on the wider context of Benghazi's continuous killings that have so far gone unpunished. One tribute reads: "What now? Does she become just another poster to carry? Another name lost? Another death that we owe a debt to?"

She gave a live TV interview just a couple of hours before being killed.

The BBC's Rana Jawad in Tripoli says there was a battle raging outside and the crackle of gunfire could be heard during the interview. Despite this, Ms Bughaighis was urging Benghazi residents to go out and vote.

She had also been a strong critic of Muammar Gaddafi and joined some of the first protests against him in 2011.

She later became an adviser to Libya's National Transitional Council which governed the country during and directly after the uprising. She leaves behind three sons.

The US Ambassador to Libya Deborah Jones said the killing was "heartbreaking".

She described the killing as a "cowardly, despicable, shameful act against a courageous woman and true Libyan patriot".

Earlier this week a candidate standing in parliamentary elections in the southern city of Sabha was assassinated, local media reported.

Libya has suffered from instability and violence since the downfall of Gaddafi in 2011.

The government has struggled to disarm the various armed groups that remained from the war.