Forces loyal to Libyan leader Col Muammar Gaddafi have launched a counter-offensive against rebels near the key western town of Zlitan.
At least seven rebels were killed after pro-Gaddafi forces attacked their positions on the outskirts of the city, east of Tripoli.
Meanwhile, Col Gaddafi's son, Saif al-Islam, vowed that fighting would continue until Libya was "liberated".
Rebels have been fighting government forces with Nato's support since March.
Over recent weeks, they have been slowly advancing on Zlitan from the port city of Misrata, 70km (45 miles) east. From Zlitan, they hope to advance to the capital, Tripoli.
A rebel spokesman told AFP news agency the rebels had advanced inside Zlitan to control the city centre, before coming under attack from troops loyal to Col Gaddafi.
"Now there is a vicious fight with Gaddafi's forces," Col Ahmed Omar Bani, who is based in Benghazi, told AFP news agency.
He said "many" troops loyal to Col Gaddafi had been killed or captured, as well as rebels.
Hospital sources told Reuters news agency that seven rebels were killed and 45 wounded in fighting on Tuesday morning.
It is unclear who currently has control of the city after hours of battles on Tuesday.
Col Bani also said that his side's forces had arrested dozens of miiltiamen allied to Col Gaddafi in the rebels' base of Benghazi in eastern Libya.
Officials also said they had also discovered files containing sensitive information about members of the rebel leadership, including a "hit-list" of 60 names on it.
On Monday, a Libyan TV broadcast showed Saif al-Islam, Col Gaddafi's son, speaking defiantly to families displaced from the eastern rebel stronghold of Benghazi.
"No-one should think that after all the sacrifices we have made, and the martyrdom of our sons, brothers and friends, we will stop fighting. Forget it," Saif al-Islam said.
"Regardless of whether Nato leaves or not, the fighting will continue until all of Libya is liberated," he added.
Saif al-Islam, the most high-profile of the Libyan leader's sons, has not been seen speaking in public for several weeks.
The Muslim holy month of Ramadan began on Monday, but fighting has continued despite fasting.
"Fasting has only increased our determination and resolve to defeat the brigades of the tyrant (Col Gaddafi) to liberate Zlitan entirely, God willing, and make our way to our capital Tripoli," frontline rebel commander Husam Hussein told AFP news agency.