More than 200 decomposing bodies have been found abandoned at a hospital in a district of the Libyan capital, Tripoli, that has seen fierce fighting.
A BBC correspondent found corpses of men, women and children on beds and in the corridors of Abu Salim's hospital.
Doctors and nurses fled after clashes erupted nearby between rebel forces and those loyal to Col Muammar Gaddafi.
Some residents accused the regime of murdering those at the hospital, but it is not yet clear how exactly they died.
Meanwhile, rebel forces faced stiff resistance as they advanced on Sirte, Col Gaddafi's birthplace and the town regarded as his last stronghold.
Rebel commanders said they were consolidating their frontline at the oil port town of Ras Lanuf, after withdrawing from positions nearer Sirte to put themselves out of range of rockets fired by pro-Gaddafi forces.
The UK said its planes carried out an overnight missile attack on a large command-and-control bunker in Sirte.
There was also intense fighting near Tripoli's international airport.
In the west, the rebels took control of the Ras Jidir border crossing with Tunisia after regime loyalists fled, and then raised the pre-Gaddafi, green, red and black Libyan flag, witnesses said.
The BBC's Wyre Davies in Tripoli says the scene at the hospital in Abu Salim was one of the most appalling and distressing he had ever seen.
Around the hospital, on trolleys and in corridors, there were hundreds of dead people - men, women and children, our correspondent says.
It is not known exactly who they were, but some were civilians, some fighters, some apparently African mercenaries, he adds.
Residents said some had been alive when they were brought to the hospital, albeit with very bad injuries. Others had already died.
However, the hospital was closed because nearly all medical staff had fled the fighting, and the people were left there to die, they added.
The AFP news agency reported that the hospital was occupied by pro-Gaddafi snipers on Saturday, and that it was only on Thursday after days of intense fighting that it was secured by the rebels.
The father of a 10-year-old boy who was shot in the back near Col Gaddafi's compound said he had to lie in the heat for almost a week with no help, while the stench of decomposing bodies grew around him.
"My son was wounded outside Bab al-Aziziya, but we didn't know where he had been taken," he told AFP. "It's the first time I've seen him in five days. But today we have got him back."
The boy was one of 17 survivors taken away for treatment by the Red Cross, one of whose workers described the conditions as "dreadful".
Osama Bilil, one of the doctors, told the BBC: "These bodies have been here in the hospital for five days. Nobody has taken care of them - to bring them to the mortuary, to identify them, to bury them."
"We need help. It is very urgent. There is no government here. We need professional help, from the International Red Cross, because there has been a massacre in Abu Salim," he added.
Our correspondent says the stench was appalling. People were trying to clean up some of the mess and return the hospital to normality, but that was an impossible task because of the sheer number of bodies, he adds.
Human rights group Amnesty International earlier said it had evidence that both pro-Gaddafi forces and the rebels had abused detainees.
Guards loyal to Col Gaddafi raped child detainees at Abu Salim prison, Amnesty said. It also accused rebels of beating prisoners, including a boy conscripted by Gaddafi forces who surrendered to the rebels at Bir Tirfas.
The UN is to investigate reports of summary killings and torture through its existing commission of inquiry on Libya. It has previously said some reports could amount to war crimes or crimes against humanity.
As news about the hospital emerged on Friday, rebel leaders said they were now in almost complete control of the capital, with just a few pockets of resistance from forces loyal to Col Gaddafi in the Abu Salim and Salah al-Din areas.
There has been some fighting, mainly in and around the international airport, but the centre of the city is mostly quiet.
Hundreds of people crowded a central mosque for the first Friday prayers since Tripoli fell to the rebels. Afterwards they poured onto the streets, chanting "Down with Gaddafi" and "Free Libya".
The BBC's Rupert Wingfield-Hayes, who has travelled around Tripoli, says there is no working government and almost no running water, but some police are returning to the streets and shops are starting to reopen.
Libya has plenty of problems ahead, but for now at least people here seem content to celebrate and to hope, he adds.
"We have been waiting for this for 42 years, so of course we're going to be happy and we're going to win," one man said.
Meanwhile the rebel administration, the National Transitional Council (NTC), said half of its leaders had moved from the eastern city of Benghazi to Tripoli.
Officials said they had been flying to a makeshift airstrip set up on a wide stretch of road in the western Nafusa mountains. They are reported to be staying outside the capital and only visiting it during the daytime.
But the chairman of the NTC, Mustafa Abdul Jalil, and other key leaders are staying in the east because of the lack of security in Tripoli, and because of the stream of foreign dignitaries wanting to meet them.
The BBC's Jon Leyne in Benghazi says the situation is unlikely change for some days or even possibly weeks.
Nevertheless, the rebels are continuing to secure more money from Libya's frozen assets and are gaining increasing international recognition as they prepare to take control of the country, he adds.
Separately, the person appointed by the NTC to protect Libya's assets, Mahmoud Badi, told the BBC that at least $2.9bn (£1.8bn) was missing from the sovereign wealth fund, the Libyan Investment Authority (LIA).
"It seems that there was a misappropriation of funds and misuse of funds and misconduct of funds," he said, adding that he suspected former government ministers and their relatives were responsible.