Tripoli, Libya (CNN) -- Opposition forces claimed a major victory Sunday in Libya, managing to block an onslaught by Libyan leader Moammar Gadhafi's troops and maintain control of the key city of Misrata, an eyewitness said.
Using machine guns, sticks and anything else they could find, crowds protected the courthouse, serving as an operations center by the opposition in Misrata, and successfully repelled Gadhafi militias armed with tanks and heavy artillery, the witness said.
"The will and the determination and dedication that people are showing here on the ground, it just makes you speechless," he said.
A doctor at Central Misrata Hospital said 42 people were killed -- 17 from the opposition and 25 from the pro-Gadhafi forces -- and that 85 people were wounded in the fighting, which continued on the city's outskirts. The youngest victim, 3 years old, was killed by direct fire, the doctor said.
Witnesses and other sources are not being named for their own safety.
Humanitarian and medical aid to the central Libyan city has been blocked, U.N. emergency relief coordinator Valerie Amos said in a statement Sunday. She urged authorities "to provide access without delay to allow aid workers to help save lives."
Fighting also raged in the town of Bin Jawad, where the sounds of booms -- either aerial bombardments or heavy artillery -- could be heard echoing. The opposition also worked to keep control of Ras Lanuf.
The battles came in stark contrast to the image Gadhafi's regime sought to portray in the capital, Tripoli. Throngs filled Green Square, cheering their support of Gadhafi, with some insisting they were celebrating the government's victory in Misrata. A government official said Gadhafi's regime was victorious in Ras Lanuf and in Zawiya, as well.
CNN was not allowed to enter Zawiya on Sunday, and could not reach people inside the city. Reports said communications had been cut off.
Libyan state TV also claimed that the government had gained control of the eastern port city of Tobruk. "Morning victory, oh people of Libya. Victory city of Tobruk from terrorist gangs," the station said.
Witnesses in Tobruk, though, said it was still under opposition control.
U.N. Secretary-General Ban Ki-Moon talked Sunday morning with Libyan Foreign Minister Musa Kasa, appealing for an end to hostilities and discussing "the increasingly troubling humanitarian situation," according to a statement from his office. The release criticized Gadhafi's government for what it called "disproportionate use of force and indiscriminate attacks on civilian targets."
After reports of the opposition successfully fighting off pro-Gadhafi forces in Misrata, Libyan state TV showed a graphic -- in both Arabic and English -- saying that "strict orders have been issued to the armed forces not to enter cities taken by terrorist gangs, who took civilians as human shields and threatened to slaughter the inhabitants of those cities." The report cited "military sources," and said those cities "are being circled by the armed forces except those neighborhoods where the terrorist gangs have sought refuge."
While the pro-Gadhafi rally in Tripoli was crowded and boisterous -- including the sounds of car horns and celebratory gunfire -- such demonstrations do not offer a clear sign of how much support the 68-year-old leader actually has.
Throughout the uprising, which began February 15, witnesses in Tripoli have described the government using all sorts of methods to drum up crowds, including forcibly dragging people to them, while keeping anti-Gadhafi demonstrators off the streets.
On Sunday, police forces searched cars to try to ensure that no anti-Gadhafi protesters were out on the streets, though some still managed to venture out, a witness said.
Traces of bullets and blood could be seen in some districts near Tripoli's Green Square, and people were mopping the streets and cleaning the walls, the witness said.
On Saturday, opposition forces had claimed two major successes: preventing pro-government forces from taking Zawiya and capturing Ras Lanuf along the coast.
Opposition forces in eastern Libya briefly detained a group of British special forces. The group was let go Sunday, British Foreign Secretary William Hague said in a statement.
"I can confirm that a small British diplomatic team has been in Benghazi. The team went to Libya to initiate contacts with the opposition. They experienced difficulties, which have now been satisfactorily resolved. They have now left Libya," Hague said in a statement.
"We intend, in consultation with the opposition, to send a further team to strengthen our dialogue in due course. This diplomatic effort is part of the UK's wider work on Libya, including our ongoing humanitarian support. We continue to press for Gadhafi to step down and we will work with the international community to support the legitimate ambitions of the Libyan people."
The strife engulfing the north African nation is reverberating across the country, the region and the world. Death toll estimates range from more than 1,000 to as many as 2,000, and the international community has been pondering strategies on how to end the violence and remove the Gadhafi regime.
The protesters are seeking the ouster of Gadhafi after nearly 42 years of ruling the country -- the kind of revolution that was seen in neighboring Tunisia and Egypt. But unlike in those countries, the uprising has turned into warfare.
Benjamin Barber, a fellow at the New York-based Demos think tank who had worked closely with the Gadhafi Foundation, told CNN's Fareed Zakaria that he felt Gadhafi, his son Saif and their supporters would likely "fight to the death" -- meaning a prolonged war, compared to the relatively quick and peaceful political transition that happened in Egypt and Tunisia.
Even if Gadhafi is somehow ousted, Barber predicted the violence could continue as tribes duke it out for supremacy in a nation that has few significant public institutions that could fill a potentially chaotic void.
Gadhafi's government has been reviled across the globe for violence against civilians, and the International Criminal Court has launched an investigation of Gadhafi, some of his sons and other leaders for possible crimes against humanity.
Opposition-controlled radio announced Saturday that the country's sole legitimate representative was now the National Transitional Council, a group with 31 representatives for most of the regions in Libya.
The council held its first meeting Saturday in the eastern city of Benghazi. It called Benghazi its temporary location until the "liberation" of the capital, according to a decree the council issued.
Former Justice Minister Mustafa Abdeljeleel, whom the council said had tried to resign from Gadhafi's government several times, was announced as the council's new leader.
The council also named a representative for military affairs and established a military council to oversee the "liberation" of Libya and reconstruct the armed forces, according to the radio announcement.
The council said its main missions are to represent all of Libya internationally, liberate the country, draft a constitution and hold elections.
Meanwhile, the fierce fighting has sparked the flight of Libyans and foreigners out of Libya, with nations across the globe scrambling to help people leave.
Almost 200,000 people have fled Libya with nearly equal numbers going to Tunisia and Egypt, the United Nations refugee agency said.
The United States announced Saturday it is contributing $3 million to the International Organization for Migration to help return home thousands of non-Libyans who fled to Tunisia.
CNN's Nic Robertson, Ben Brumfield, Arwa Damon, Ben Wedeman, Salma Abdelaziz, Jomana Karadsheh, Jill Dougherty and Christine Theodorou contributed to this report