Military forces loyal to Libya's eastern government said on Sunday they had pushed back Islamist fighters in several areas of Benghazi, seizing the strategic port of Marisa.
The Libyan National Army said it had also taken control of the town of Ajdabiya, about 150 kilometres south of Benghazi, another city where it has been battling Islamist groups.
Libya has been torn apart by conflict since the 2011 uprising against Moammar Gadhafi, as armed factions supporting rival governments in Tripoli and the east have fought for power and a share of the country's oil wealth.
Islamist fighters have used the resulting security vacuum to expand their presence, and militants loyal to Islamic State have gained control of the city of Sirte, to the west of Ajdabiya.
Benghazi, Libya's second-largest city, has seen some of the worst fighting, with violence escalating when military commander Khalifa Haftar launched a campaign in 2014 against Islamists and other armed groups.
Munthir al-Khartoush, a spokesman for the army's Battalion 309, said that besides Marisa port, the army had taken control of the nearby neighbourhood of Al-Halis and had advanced in the district of Boatni, which also saw heavy fighting on Saturday.
At least three soldiers and 15 Islamist fighters were killed in Sunday's clashes, the military said. Marisa would be a significant gain for the army.
The groups it has been fighting have been receiving deliveries of weapons through the port. "We have completely cut off the supplies coming to the front line for the Islamist groups in the west of Benghazi by capturing Marisa Port," Khartoush said.
Later, military sources said the army had also captured Al-Hawari hospital in northern Benghazi. Health care has been badly affected by the violence, and a medical source said that if the hospital could be protected from further fighting it would make a major difference to medical services in the city.
In Ajdabiya, military spokesman Akram Bouhaliqa said the army had forced Islamist fighters from the area around Galouz Street and the industrial zone, the last positions they held.
A resident also confirmed to Reuters that the army was in control of the city. Three soldiers were killed in Sunday's clashes, Bouhaliqa said.
A hospital source in Ajdabiya said 65 people had been killed and 140 wounded in fighting there over the past two months.
The violence comes as a unity government nominated under a United Nations-backed plan is trying to win approval from Libya's internationally recognized parliament in the east .
It also comes two days after a U.S. air strike targeting a suspected Islamic State training camp in the western city of Sabratha killed nearly 50 people, including two Serbian embassy staff abducted in Libya in November.