The Libyan coastal city of Sirte was on the brink of falling to government forces as fighters loyal to the former Libyan leader Muammar Gaddafi were trapped in a tightening pocket 500 metres wide and twice as long.

The latest gains for the forces of the National Transitional Council (NTC) came as its officials said Gaddafi's son Mutassim, who had been commanding the city's defences, had been captured in a car trying to flee with his family on Tuesday evening and taken to Benghazi for questioning.

News of the capture, which was announced by Colonel Abdullah Naker of the NTC, spread quickly around jubilant government fighters in the area who fired tracer and anti-aircraft rounds into the air to celebrate.

The reported arrest of Mutassim – referred to as "Number 1" on pro-Gaddafi forces radio traffic – underlined the depth of the collapse of Sirte's loyalist defenders in the past week. Mutassim is the first major figure in Gaddafi's inner circle to have been captured by the NTC.

"More than 80% of Sirte is now under our control. Gaddafi's men are still in parts of neighbourhood No 2 and the 'Dollar' neighbourhood," said NTC field commander, Mustah Hamza, early in the day.

By afternoon, it appeared that barely 5% of the city remained under the control of those fighting for Gaddafi, who is still on the run after ruling Libya for 42 years. As government forces completed the clearing of the city's east, rumours began to circulate that it had finally capitulated. "Sirte is free!" said one man heading to join the fighting in the city centre.

Behind him, about 30 heavily armed pickup trucks had gathered in Green Square, firing weapons in the air near a group of prisoners.

As loyalist fighters cleared houses, posters depicting Gaddafi were doused in petrol and set on fire while green flags – the symbol of Gaddafi's rule – were torn down or shot through. "We have to clear these streets and houses one by one," said Lofti al-Amin, a fighter wearing a peaked airline pilot's hat. "We have found 10 guns so far and taken seven prisoners. We go into the houses and, if there are people there, we ask if they have guns. If they don't, we try to help them leave."

In one street, surrounded by the sound of conflict, a family tried to pack straw under the wheels of their bogged-down car so they could escape the fighting. There was widespread looting and a steady procession of expensive cars – many damaged by gunfire – were being towed out of the city.

Libya's de facto leader, Mustafa Abdul-Jalil, said he was optimistic that the ex-rebels would declare total victory in less than a week, opening the way for a new transitional government to be formed within a month. "I hope that liberation will be declared in less than a week, after we free Sirte, and within less than a month we will form a transitional government and the youth and women will have a role in that," he said.

Libya's new rulers have promised to declare victory after the capture of Sirte and to name a new government that will guide the oil-rich north African nation to elections within eight months.

Gaddafi's supporters hold the desert enclave of Bani Walid, but the new leaders say Sirte's capture will give them full control of the country's ports and harbours, allowing them to move forward with efforts to establish a democracy.

With nowhere to escape and hemmed in from three sides, a hardcore of the defenders of Gaddafi's home town – perhaps fearful of the treatment they believed they would receive if captured – continued to fight it out against hopeless odds.

At times, government fighters were forced to try to advance through thigh-deep water and sewage flooding large parts of the streets of District 2, the western neighbourhood and last location where Gaddafi forces are still holding out. Shots from the high buildings ahead of them threw up small spouts of water. Occasionally a pro-Gaddafi fighter could be seen on a rooftop.

According to government fighters, the area had been deliberately flooded to slow them as they cleared the last streets under Gaddafi control.

Despite the inevitability of defeat in Sirte, machine gunners on the rooftops continued to target the government forces while others fired RPGs and mortars. In one frontline area where fighters were gathering, one building was repeatedly hit, bullets ripping across its top floors.

The government forces replied with volleys of rockets and anti-aircraft fire that left the buildings being targeted blackened and shattered.

The already angry mood towards the loyalists hardened with the discovery, in three locations in the city, of 30 captured men who had been cuffed and executed. According to government commanders, the men had been killed on Tuesday.

International Medical Corps, a non-profit organisation, said it visited the Ibn Sina hospital in Sirte on Tuesday and said it was "functioning at the bare minimum".

The organisation is providing staffing and support to the field hospital, 30 miles outside Sirte. It says more than 600 patients have been seen at the field hospital, 359 seen in the first week of October and 226 on 7 October alone, when forces loyal to the interim government launched their major offensive on Sirte.

The IMC director for Libya, Hakan Bilgin, said: "We have got people who are being injured directly related to the conflict, we've got people having respiratory problems owing to stress, people not having proper medication, people suffering from fatigue. We've been to the Ibn Sina hospital. It is in very bad shape, almost destroyed. It is unusable."