A security official said the attack, the first in over a year in the bastion of Libyan military strongman Khalifa Haftar, targeted servicemen at the funeral of Khalifa al-Mesmari, a special forces chief under Libya's ousted leader Moamer Kadhafi.

The Mediterranean city's hospitals, giving a revised casualty toll of four dead and 33 wounded, said two of those killed were civilians.

The other two were special forces members, Haftar's spokesman General Ahmad al-Mesmari, who was among the mourners at the funeral, told a press conference.

There was no immediate claim of responsibility for the attack.

Benghazi, Libya's second city and the cradle of the 2011 uprising that overthrew Kadhafi, was hit by years of violence targeting diplomatic offices and security forces after his fall.

An attack on the US consulate on September 11, 2012, killed US ambassador Christopher Stevens and three other Americans.

The last attack in Benghazi in May 2018 left seven people dead.

In 2017, Haftar drove hardline Islamists and jihadists out of Benghazi after a brutal three-year battle.

He went on to seize Derna, the last city in eastern Libya outside his control.

In early 2019, Haftar ordered his self-styled Libyan National Army to purge the south of what he called "terrorist groups and criminals".

On the heels of that campaign, his LNA launched in April an offensive to take the Libyan capital from the UN-recognised Government of National Accord.

Fighting on Tripoli's outskirts has since killed 1,048 people, including 106 civilians, and left 5,558 wounded, including 289 civilians, according to a report released Tuesday by the UN's World Health Organization.