Libyan authorities said the unusually heavy gunfire, which also broke out in the neighborhood of Gadhafi's residence, began around 5:30 a.m.
They said it was celebratory, claiming that government forces had retaken the oil port of Ras Lanouf, in central Libya. But residents of Ras Lanouf said Sunday that the opposition remained in control of the port.
On Saturday, rebel forces in captured the oil port town of Ras Lanouf. The city fell into rebel hands Friday night after a fierce battle with pro-Gadhafi forces.
The contrasting fortunes of the two warring sides suggest that the conflict in Libya could last for weeks and maybe months, with neither side mustering enough military power to decisively defeat the other.
The government is fighting fiercely to maintain its hold in Tripoli and surrounding areas and the rebels are pushing their front westward from their eastern stronghold.
Meantime YouTube video shows a setback for rebels in Zawiyah, the city closest to the capitol of Tripoli. Saturday morning, pro-Gadhafi forces broke through rebel lines there.
At least 37 people were killed, including the commander of the rebel forces.
Pro-Gadhafi forces are also suspected in a massive explosion at an arms depot in the rebel controlled city of Benghazi.
At least 26 people were killed in that attack.
Gadhafi, who has led the country virtually unchecked for four decades, has unleashed a violent crackdown against those seeking his ouster, drawing international condemnation and sanctions.
Hundreds have been killed, perhaps more, putting pressure on the international community to do more to stop the crackdown on protests that began on Feb. 15, inspired by successful uprisings in Egypt and Tunisia, its neighbors to the east and west respectively.
President Barack Obama has insisted that Gadhafi must leave and said his administration was considering a full range of options, including the imposition of a "no-fly" zone over Libya.
The Associated Press contributed to this story.