Rebels reported heavy fighting in the city but journalists taken on a government-provided tour of the area said it appeared to be under government control, the BBC reported Monday.
Spokesman Moussa Ibrahim said an attack by rebel fighters had been repelled.
"The wishful reporting of some journalists that the rebels are gaining more power and more control of some areas is not correct," Ibrahim said.
Rebel forces "were defeated after a few hours of scattered skirmishes with the army," the spokesman said.
Journalists on the tour reported the national flag was flying in the city's central square.
The BBC reported clashes were erupting on several fronts, including the rebel-held port city of Misurata and the government-controlled city of Brega.
The report said rebels are using Tunisia -- which had its president toppled by a popular uprising -- to smuggle weapons in their fight to oust Gadhafi after four decades of rule. Libyan smugglers have been seen carrying AK-47 rifles and grenade launchers across the Tunisian-Libyan border to aid rebels.
Some Libyans living away from their country are funding the purchase of small arms and many Tunisians are sympathetic to the rebel cause, a smuggler said.
Justin Bieber crashes Drake Bell's album release party
Members of Congress to keep receiving porn magazine