The head of Libya's National Transitional Council (NTC) has announced the end of the Gaddafi era, while sporadic fighting continued across the capital, Tripoli.

Fighting and gun battles erupted in parts of Tripoli on Monday after tanks left Bab al-Azizyah, Muammar Gaddafi's compound, to confront the rebel assault that gained control of much of the capital in a battle overnight.

Many of the streets in the centre of the city - where anti-government supporters had celebrated hours earlier - were abandoned as pockets of pro-Gaddafi resistance and the presence of snipers and artillery fire made the area dangerous.

Al Jazeera's Zeina Khodr, who entered the city with rebel fighters who advanced overnight on Sunday, said the security situation in the city was "tenuous," despite there being celebrations in the streets.

"There are some Gaddafi forces still putting up a fight," our correspondent said.

"And rebels still have one last push to make towards Bab al-Azizyah," Khodr added, saying that it was unclear when this advance would take place.

Al Jazeera has heard reports of sustained gunfire from inside Gaddafi's compound there. Opposition fighters also said pro-Gaddafi forces were fighting rebels in and around the area of al-Mansoura.

Regime forces also remained in control of the streets around the Rixos Hotel, where many Western journalists are based.

In other developments:

For the latest news, follow our Libya Live Blog

Meanwhile, speaking at a press conference in the rebel stronghold Benghazi, the NTC's Mustafa Abdel Jalil acknowledged that Libya still faced many challenges, including maintaining law and order.

"Jalil spoke at length saying that it wasn't going to be a bed of roses and a great number of challenges lay ahead for the Libyan people," Al Jazeera's Jacky Rowland reported from Benghazi.

Rowland called Jalil "a very moderate voice, a voice calling for common sense and reason" at this sensitive time.

She said: "He called on people in Tripoli to respect people's lives and people's property ... he also stressed that there should not be a case of people taking the law into their own hands".

Jalil said Gaddafi had left a legacy of violence against his own people and the world.

He said he hoped that Gaddafi was captured alive so that he could be put on trial.

"We will provide him with a fair trial. But I have no idea how he will defend himself against these crimes that he committed against the Libyan people and the world," Jalil said.

Defiant audio messages

There has been no word on the location of Gaddafi himself. The Libyan leader has delivered a series of angry and defiant audio messages in recent days, vowing not to surrender.

In the most recent address, he acknowledged that opposition forces were moving into Tripoli and said the city would be turned into another Baghdad. He also called on Libya's tribes to rally to the city's defence.

"How come you allow Tripoli, the capital, to be under occupation once again?" he said. "The traitors are paving the way for the occupation forces to be deployed in Tripoli."

Opposition forces and Tripoli residents were trying to maintain order in the city on Monday, said Khodr.

NTC's Jalil announces the 'end of Gaddafi era'

"They have set up checkpoints, are searching cars and looking for possible Gaddafi supporters, because ever since late last night they were worried about sleeper cells in the capital."

Ban Ki-moon, the UN secretary-general, meanwhile welcomed assurances from rebel leader Jalil that extreme care would be taken to protect civilians and maintain law and order.

On Monday, he told reporters it was important that the conflict ended with no further loss of life and without retribution.

Ban urged forces loyal Gaddafi to stop fighting immediately and make way for "a smooth transition'' that ensures a free and democratic future for the country.

He also announced that he will hold a meeting on Libya later this week with major organisations, including the Arab League, African Union and European Union.

Opposition hold majority control

An opposition fighter in Tripoli told Al Jazeera that only about 20 per cent of the capital city was in the hands of Gaddafi supporters.

"NATO air forces are above us, I am not sure if they are going to strike or if they are just here for surveillance."

Anders Fogh Rasmussen, the NATO secretary-general, said NATO was ready to work with the Libyan NTC, and "our goal throughout this conflict has been to protect the people of Libya".

Rebel leader calls for restraint and compassion

With Gaddafi's grip on power apparently slipping, speculation has begun on where he may flee if Tripoli falls into rebel hands.

The Pentagon has said the US does not believe Gaddafi has already left Libya.

Some have suggested that he could be in neighbouring Algeria or in remote southern Libya. There were also claims that he may be talking to regional allies in Africa.

At a press conference, Maite Nkoana-Mashabane, South Africa's foreign minister, said Pretoria was not facilitating Gaddafi's exit and did not know the 69-year-old leader's current whereabouts. 

Nkoana-Mashabane added that South Africa had no plans at the moment to recognise the rebel government if Gaddafi falls.

“The Libyans themselves  must be given the chance to decide the future of their country and the future of Gaddafi," Nkoana-Mashabane said.

Al Jazeera's correspondent in Johannesburg, Haru Mutasa, said Angola and Zimbabwe had been cited as countries the embattled leader was most likely to go to.

Source: Al Jazeera and agencies