Muammar Gaddafi is calling for supporters from across Libya to help him defend Tripoli, with rebel forces now in control of parts of the capital and massing on its western outskirts for a decisive assault.

As Libya's dictator prepares for what is widely expected to be his last stand, he vowed that he would not be forced into exile.

"We will fight to the last drop of blood," he said. "We will never give up."

He warned of a furious fight ahead, with the remnants of the Libyan army and well-armed vigilantes bracing for urban warfare. As government forces went into full retreat towards the capital from the road west to Zawiya and from al-Aziziya, 30 miles (45km) to the south, Gaddafi again called the rebels "rats".

"All the patriots of Libya, come to defend the capital," he said, adding that he feared "Tripoli would burn".

Rebels have advanced to within 12 miles of Tripoli, seizing the town of Jadda'im and an outpost called Bridge 27, 17 miles from the centre of the capital, as they pushed east from the captured city of Zawiya.

Gaddafi maintains a strong base of support within the city he has ruled for 42 years, but neither its size nor resilience has been tested during the six months of civil war, in which government forces there have successfully crushed dissent and retained control. However, in a sign that his strongman rule may be crumbling, rebels claimed to have arrived in Tripoli by boat to reinforce the rebellion in the east of the capital.

Elsewhere in the capital, one of the largest military bases was overrun by rebel forces, who freed up to 5,000 people imprisoned by the regime and then swung open the doors of the armoury, allowing thousands of rebel supporters to seize weapons. Reports from the scene at the Mais base revealed residents were celebrating wildly.

But regime officials insisted the capital would be defended. "We have thousands of professional soldiers and thousands of volunteers protecting the city," Moussa Ibrahim, the Libyan government's information minister, warned in advance of the expected rebel attack, adding that European countries that backed the rebels had "intensified an immoral campaign against our people … We hold Mr Obama, Mr Cameron and Mr Sarkozy responsible for every death that takes place in this country."

Observers inside the capital said barricades had been erected in some suburbs and soldiers had taken up defensive positions. Weapons and ammunition were distributed to loyalists earlier in the uprising, raising the prospect of prolonged guerrilla warfare within the city.

Gaddafi's heavily fortified compound in the centre of Tripoli was bombed again by Nato jets early on Sunday, and only several miles away uprisings were reported to be underway in the suburbs of Tajoura and Fashloum. Sustained gunfire from both areas on Saturday night appeared to mark the first time that rebel movements in either area had been able to gain momentum since anti-regime protests erupted on 17 February.

Rebel forces claimed on Sunday to be in control of Tajoura, the light industrial district on Tripoli's south-eastern flank. The rebel National Transitional Council's tricolour flag, which was last flown under the monarch King Idris, whom Gaddafi ousted in a military coup in 1969, was raised over many homes in the neighbourhood.

Opposition troops were attempting to consolidate gains in the capital by trying to seize control of a disused airfield on the city's eastern edges in a bid to establish a supply line. Their rapid advances of the past week have already shut off a government supply line to the Tunisian border and tightening a stranglehold on an already weakened regime.

Tripoli residents are reported to be fleeing in large numbers, with most being allowed to pass through rebel-held Zawiya to the Ras Jdir crossing into Tunisia.

Meanwhile, to the east of the capital, rebels also made gains, creeping forward from the city of Zlitan, 80 miles from Tripoli, which had been heavily contested by one of Gaddafi's most effective military units.

One rebel offensive has reached the Sdada bridge, 60 miles south of Misrata, which fell into rebel hands last month after three months of some of the fiercest fighting of the war.

Opposition fighters claimed that a captured government soldier told them that Gaddafi's son, Khamis, sustained facial injuries during the rebel assault on Zlitan on Friday. Khamis commands the elite 32nd brigade, which retreated from the town. Another of Gaddafi's sons, Saif al-Arab, was killed by a Nato strike in April.

Gaddafi has spent much of the past five months sleeping in Tripoli hospitals, or in rooms in the city's largely empty five-star hotels. He is likely to be a prime target for rebel leaders once they reach Tripoli, but is known to be protected by a die-hard unit that would not let him be taken alive without instructions from Gaddafi himself.

His other military forces have been severely weakened during months of fighting and more than 1,000 bombing raids by Nato jets, which have focused heavily on weapons stockpiles and command and control centres.

Even if Gaddafi backed down, he has few options inside or out of Libya. The international criminal court has issued warrants for him and key regime officials, which means he is at risk if he travels to any country that recognises the jurisdiction of the ICC.

Fierce clashes are reported between rebels and Gaddafi forces in the Abu Salim district in Tripoli, just south of Gaddafi's former compound. There is speculation that Gaddafi – or one or more of his sons – may be holding out in the district