Around 10 to 15 minutes later, after security and health officials had arrived on the scene, a second more powerful blast was detonated from a Mercedes parked on the opposite side of the street.
The second blast also hit an ambulance and caused a higher number of casualties than the first.
The victims include both military personnel and civilians, with health officials saying the death toll could rise because some of the wounded are in critical conditions.
One of the men killed was Ahmed al-Feitouri of the investigation and arrest unit attached to the general command of east Libyan security forces.
Another victim includes an Egyptian national who was employed in a vegetable shop in front of the mosque.
An intelligence official, Mahdi al-Fellah, was wounded.
No group has yet claimed responsibility for the bombings, although the United Nations has condemned the attack saying that direct or indiscriminate attacks on civilians are prohibited under international humanitarian law and constitute war crimes.
Benghazi was the scene of more than three years of conflict from 2014 until late last year, as forces loyal to eastern-based commander Khalifa Haftar battles Islamists and other opponents.
Haftar's Libyan National Army (LNA) claimed control of its rivals' final hold on the port city in December.
There have however been occasional bomb attacks in Benghazi in recent months, often outside mosques.
The fighting in Benghazi was part of a broader conflict that developed in Libya after former ruler Muammar Gaddafi was removed from power and killed in a Nato-backed uprising in 2011.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies