US secretary of state Hillary Clinton made a surprise visit to Libya to show American support for the transitional government, as diehard forces loyal to Moamar Gaddafi launched a counter-attack in his home town of Sirte.

Ms Clinton is the first US cabinet member to visit the capital, Tripoli, since the fugitive ousted leader's 42-year rule ended.

Her visit comes amid reports that an Australian aid worker has been killed in Libya.

Latest developments: In Sirte, where Gaddafi loyalists have been under siege for weeks, there was little or no sign of NTC forces making any progress and in some places they had even been pushed back.

Residents returning to Sirte accused Libyan interim government fighters of demolishing and looting homes, shops and public buildings in Gaddafi's home town to take revenge for its support of the fugitive leader. After weeks on the run, thousands of black Libyans driven from their homes during the revolt against Gaddafi have found refuge in a squalid camp they hope is only temporary.

Her arrival was marked by tight security, reflecting worries that the new rulers have yet to establish full control over the country.

Ms Clinton's visit was aimed at cementing a partnership with the new government and helping it steer towards democracy.

She encouraged the National Transitional Council (NTC) to fulfil pledges to move swiftly towards elections.

"This is Libya's moment. This is Libya's victory. The future belongs to you," she said, eight months after Libyans rose up against Gaddafi, sparking a conflict that has killed thousands.

But she also warned against the perils of civil war.

"One factor we know must be confronted is unifying the various militias into a single military that represents the Libyan people," she said.

"Putting a national army and a police force under civilian command is essential."

The US is also offering Libya practical help to contain the thousands of weapons flooding the country in the wake of the war to oust Gaddafi. Security experts say these could fall into the hands of Al Qaeda.

The US took part in the NATO bombing campaign that helped the NTC take power, although its aircraft largely played a secondary role to Britain and France.

Sirte setback

Nearly two months since capturing Tripoli, the NTC has failed to defeat remaining Gaddafi loyalists, raising questions about its ability to exert its authority over the entire country and postponing the launch of its promised democracy program.

Ms Clinton arrived as the interim government was facing a military reverse in Sirte, a city on the Mediterranean coast where a few days ago it was poised to declare victory over pro-Gaddafi forces.

Sirte is now the last major Libyan town where pro-Gaddafi forces are holding out, after the other bastion of resistance, Bani Walid, fell to the country's new rulers on Monday.

Gaddafi loyalists who had been cornered in a an area of Sirte of about two square kilometres appeared to have broken out of their encirclement, Reuters reporters in the city said.

A group of NTC fighters was forced to pull back about 2km after they came under heavy fire.

The force was trying to regroup near the Ouagadougou conference centre - the complex where Gaddafi used to host foreign heads of state - but were pinned down.

A volley of 22mm rounds from Gaddafi loyalists thudded into the group, hitting four vehicles and seriously wounding one NTC fighter. He was loaded into an ambulance and driven away.

On the southern outskirts of the city, in an area that in previous days had been safe from gunfire, mortars were landing and air-burst rounds were exploding overhead.

A National Transitional Council (NTC) fighter gestures as he takes positions during a shoot-out with troops loyal to Moamar Gaddafi in Sirte on October 10, 2011. ( Aris Messinis: AFP )

Reuters