A renegade Libyan general launched a fresh attack against Islamist militants in the eastern city of Benghazi killing 12.
It sparked some of the worst fighting in weeks and power supplies were disrupted.
Libyan authorities are struggling to restore order across the vast desert nation ahead of a 25 June parliamentary election.
The situation remains especially chaotic in Benghazi, Libya's second-largest city and cradle of the NATO-backed uprising that toppled Muammar Gaddafi three years ago.
Retired General Khalifa Haftar has declared war against militants in Benghazi and several army units have joined him.
The Tripoli government says it has no authority to act but its orders are routinely ignored in much of the country.
Orders are especially ignored in the east, as rival militias and tribal groups vie for control.
Haftar's troops, backed by tanks and rocket launchers,attacked several suspected camps of Islamists in western areas of Benghazi.
Dozens of families were forced to flee. Warplanes could also be heard circling above the city.
Benghazi and much of eastern Libya suffered power outages after rockets hit a power station near the city's airport, the state electricity firm said.
At least five soldiers and three civilians were killed, among them two Sudanese, hospital workers told Reuters, adding that at least 18 people had been wounded.
Quoting medical sources, state news agency LANA put the number of killed at 12, adding that 16 had been wounded.
Haftar's spokesman, Mohamed El Hejazi, said his forces had detained five leaders from militant groups.
There has been speculation among analysts that Haftar has the support of neighbouring Egypt and of Gulf states such as the United Arab Emirates, which like the West are worried about Islamist militants exploiting the chaos in Libya.
Haftar told Saudi-owned Arabiya television that his forces were being supported by Libya's neighbours to help secure the country's borders, according to the channel's website.
He did not elaborate and he later issued a denial of any such support.