Rebels and forces of Libyan leader Muammar Gaddafi have fought over Zawiyah, a major oil port just 50km west of Tripoli, and in locations across the North African country.
Libya's government said it has stopped opposition fighters from entering Zawiyah but rebels said they were continuing to fight for the town on Sunday, after hours of battles.
Mussa Ibrahim, the government spokesman, said that Gaddafi's forces had "total control" of the area from Ajdabiya in the east to the Tunisian border in the west.
"It is pockets of resistance. The rebels there are no more than a hundred. The army has killed some of them, captured others and is negotiating the surrender of others," he said.
Thirteen people were reported killed in clashes in Zawiyah.
When government officials took reporters from Tripoli to Zawiyah to show that the city was under government control, a Reuters journalist reported hearing shots being fired near the central square.