Heavy gunfire and explosions rattled the Libyan capital Saturday after rebels seized control of a major coastal city just west of Tripoli, with rebel commanders saying the firing in the capital signalled the start of an attack on Moammar Gadhafi's main stronghold.

Gun battles and rounds of mortar shelling were heard clearly at the hotel where foreign correspondents stay in the capital.

Also, NATO aircraft carried out heavy bombing runs after nightfall.

Col. Fadlallah Haroun, a rebel military commander in their stronghold of Benghazi said this marks the beginning of Operation Mermaid — a nickname for the capital city — an assault on Tripoli co-ordinated with NATO.

Haroun told The Associated Press that weapons were assembled and sent by tugboats to Tripoli on Friday night.

"The fighters in Tripoli are rising up in two places at the moment — some are in the Tajoura neighborhood and the other is near the Matiga [international] airport," he told the Arabic satellite channel Al-Jazeera.

The head of the National Transitional Council said the date of Aug. 20 was chosen to co-ordinate with the ancient Battle of Badr,  when Muslims first fought for the holy city of Mecca in A.D. 624.

"We planned this operation with NATO, our Arab associates and our rebel fighters in Tripoli and commanders in Benghazi," he said.

Government spokesman Moussa Ibrahim appeared on Libyan television to deny that there was an uprising in Tripoli.

"Sure, there were some armed militants who escaped into some neighbourhoods and there were some scuffles, but we dealt with it within a half hour and it is now calm," he said.

Traitors and 'vermin' tearing Libya apart, Gadhafi says

A couple of hours after the rebels said they had attacked Tripoli, state television ran what appeared to be a live audio message by Libyan leader Moammar Gadhafi. He did not appear on television but sounded like he was calling the message in on a poor phone line which crackled at times. He announced the time and date twice to prove that he was speaking live.

Gadhafi condemned the rebels as traitors and "vermin" who are tearing Libya apart and said they were being chased from city to city.

"Libyans wanted to enjoy a peaceful Ramadan," he said. "Instead they have been made into refugees. What are we? Palestinians?"

The attack on the capital came after Libyan rebels took full control of the strategic western city of Zawiya earlier in the day, pushing Moammar Gadhafi's troops back on the road east to Tripoli.

An Associated Press reporter on Saturday visited positions held by Gadhafi troops over the past week — all of which are now under rebel control.

The victory in Zawiya is an important boost for the rebels as they try to tighten the noose on Gadhafi's stronghold in Tripoli, just 50 kilometres to the east.

The regime appears to be increasingly isolated, and is scrambling to marshal all the forces available to it to hold back rebels at the western front.

si-libya-300-121580079

A Libyan boy sits atop a destroyed Libyan army tank in Zawiya, about 40 kilometres west of Tripoli, on Saturday, one day after the anti-government Libyan opposition claimed control of the western refinery town. (Filippo Monteforte/AFP/Getty Images)

Battles had raged Friday over control of the city centre. Gadhafi's forces pounded rebel-held areas of the city with rockets, mortars and anti-aircraft fire, but by nightfall were pushed out of a multi-storey hotel on the square.

Rebel fighters said Gadhafi's troops put up little resistance before fleeing their posts in Zawiya's hospital and buildings around the main square.

Trucks and cars packed with rebels as well as civilians drove around Zawiya's central square, honking horns, flashing V-for-victory signs and yelling "Allahu akbar" — "God is great!" An ambulance crew posed for photos on the sidewalk while a rebel called through a loudspeaker on his truck, "Zawiya is liberated!"

Still, regime troops kept firing rockets and mortars at Zawiya from positions in the east even after rebels said they drove them out, and thunderous booms echoed across the city. The central hospital was hit by mortar rounds early Saturday, several hours after it was taken by rebels. The attack badly damaged the operating rooms, punching a hole into one of the outer walls. Metal slats from the ceiling were strewn across the floor and soot covered the operating tables.

Soldiers quashed an earlier uprising in Zawiya in March, which is largely sympathetic to the rebels. The government razed a central mosque that was used by rebels as a makeshift hospital during the uprising.

Fighters from Zawiya fled into the farmlands surrounding the city, laying in wait for other rebels to join them to retake the city.