Libyan rebels have taken the oil port city of Ras Lanouf as Qaddafi forces tried to take back the opposition-held city of Zawiya Friday. At least 37 people were killed in the clashes, according to Reuters.

Meanwhile, Hospital officials in the rebel stronghold of Benghazi say an explosion at an ammunition depot has killed at least 17 people.

Dr. Habib al-Obeidi in Benghazi's al-Jalaa hospital says Friday's blast at a military base also hit a nearby residential area. Witnesses on the scene, about 20 miles from downtown, say ambulances are rushing to the area and secondary explosions caused two fire trucks to blow up.

The cause of the blast is unclear. Al-Obeidi says it apparently was triggered when people went into the storage facility to collect weapons, but others blamed pro-Qaddafi forces for triggering the blast.

In Tripoli, Qaddafi loyalists fired tear gas and live ammunition to smother a new outbreak of protests.

The fighting underlined how both sides are pushing against the deadlock that has gripped Libya's 18-day-old upheaval. The rebellion has broken away the entire eastern half of the country from Qaddafi's control and has swept over several cities in the west close to the capital.

So far, Qaddafi has had little success in taking back territory, with several rebel cities repelling assaults in the past weeks. But the opposition forces have seemed unable to go on the offensive to march on areas still under. Meanwhile, in Tripoli -- Qaddafi's most important bastion -- his loyalists have waged a campaign of terror to ensure that protesters do not rise up in significant numbers.

Friday's assault on the rebel city of Zawiya, about 30 miles west of Tripoli, appeared to be the strongest yet by Qaddafi's forces after repeated earlier forays against it were beaten back.

In the morning, troops from the elite Khamis Brigade -- named after the son of Qaddafi who commands it -- bombarded the city's western edges with mortars, heavy machine guns, tanks and anti-aircraft guns, several residents said. By the evening, they had also opened a front on the eastern side. Armed Zawiya citizens backed by allied army units were fighting back.

The commander of the rebel forces -- Hussein Darbouk -- was shot to death by fire from an anti-aircraft gun, said Alaa al-Zawi, an activist in the city. Darbouk was a colonel in Qaddafi's army who defected along with other army troops in Zawiya early on in the uprising.

A witness who was at Zawiya's hospital said at least 18 people in the city were killed and 120 wounded. Libyan state TV claimed the attackers had retaken the city. But al-Zawi, the witness and other residents said it remained in opposition hands, with skirmishes continuing after nightfall.

They and other witnesses and residents around the country spoke on condition of anonymity for fear of retaliation.

The day's other fighting took place at Ras Lanouf, a small oil port 380 miles east of Tripoli, just outside the long swath of eastern Libya controlled by the opposition.

Rebels attacked Ras Lanouf on Friday afternoon, feeling flush with victory after repelling Qaddafi forces who attacked them days earlier at Brega, a larger oil facility just to the east. Fighters armed with Kalashnikovs and heavy machine guns were seen streaming in pickup trucks and other vehicles from Brega heading in the direction of Ras Lanouf.

They battled with about 3,000 pro-Qaddafi troops, mainly around the facility's airstrip, said a resident of the town. She reported heavy explosions starting around 4 p.m. As night fell, the explosions eased, she said, but it was not clear who was in control of the complex, which includes a port and storage facilities for crude coming from fields in the deserts to the south.

The fall of other parts of the country has made control of the capital Tripoli, his strongest bastion, crucial for Qaddafi. His loyalists have taken fierce action to ensure protesters cannot rise up and overwhelm the city as they have in other places.

Last week, Friday marches were met by barrages of gunfire from militiamen shooting into crowds, killing a still undetermined number. Since then, pro-Gadhafi forces have carried out a wave of arrests against suspected demonstrators, snatching some from their homes in nighttime raids, instilling fear in the most restive neighborhoods.

In the latest opposition attempt, more than 1,500 protesters marched out of the Murad Agha mosque after noon prayers Friday in the eastern Tripoli district of Tajoura, chanting "the people want to bring the regime down" and waved the red, black and green flag of Libya's pre-Qaddafi monarchy, adopted as the banner up the uprising.

But pro-Qaddafi forces quickly moved in. They fired volleys of tear gas and -- when the marchers continued -- opened fire with live ammunition, according to witnesses.

It was not clear if they fired at the crowd or into the air, but the protesters scattered, many of them taking refuge back in the mosque, according to an Associated Press reporter at the scene. A doctor said several people were wounded and taken to a nearby hospital.

"All these people are threatened with death," said a 35-year-old among the Tajoura protesters Friday. "We have no education, no economy, no infrastructure. ... We want nothing but the end of the regime. We were born free but he is suppressing us." He said he had recently had kidney surgery, but "look at me, still I went out with the people because we are oppressed people."

"I am not afraid," said another man in the march. "We want to show the world that we are not afraid."

The fear seemed to have had an impact, and some protests in other parts of the capital didn't get off the ground. One resident said he went to prayers at a downtown mosque and found police officers standing outside to ensure no one marched. After prayers, the worshippers dispersed without protests.

Instead, dozens of Qaddafi supporters turned up for a counterdemonstration in Tripoli's central Green Square, waving green flags.

Before prayers, the worshippers gathering inside the Murad Agha mosque debated what to do. They said messages between Tripoli organizers were being aired on radio being aired from Benghazi, the main city in the opposition-held east, and audible in the capital.

At one point, they decided to hold a sit-in inside the mosque to avoid coming under gunfire by stepping outside. In the mosque's courtyard, they burned a copy of the Green Book, Qaddafi's political manifesto, as well as the green flag of Qaddafi's Libya.

At the same time, young men from the neighborhood transformed a nearby square, tearing down posters of the Libyan leader and replacing them with the flags. They spray-painted walls with graffiti reading, "Down with Qaddafi" and "Tajoura will dig your grave."

In the end, the 400 worshippers in the mosque decided to march, joined by hundreds of others.

Ahead of the planned protests, Internet services, which have been spotty throughout Libya's upheaval, appeared to be halted completely in Tripoli on Friday. Renesys Corp., a Manchester, New Hampshire, company that maps the pathways of the Internet, said it wasn't able to reach any of the websites it tried to access inside Libya on Friday. Google's transparency report, which shows traffic to the company's sites from various countries, also showed that Internet traffic had fallen to zero in Libya.

Libyan authorities briefly barred many foreign journalists from leaving their hotel in Tripoli, claiming it was for their protection because they had information "Al Qaeda elements" plan to open fire on police to spark clashes. They later allowed them to go out into Tripoli.

Several hours before prayers, security forces began to take up positions. In Tajoura, police set up two checkpoints on the main highway leading to downtown. They stopped cars to search them, check drivers' ID and ask where they were going or coming from.

Qaddafi loyalists in the capital have unleashed a wave of arrests and disappearances since last Friday's bloodshed. Bodies of people who vanished have been dumped in the street. Gunmen in SUVs have descended on homes in the night to drag away suspected protesters, identified by video footage of protests that militiamen have pored through to spot faces. Other militiamen have searched hospitals for wounded to take away.

The Associated Press contributed to this report.