While parts of Libya's northern coast have changed hands from day to day, the conflict in Misrata turned into a long and lethal stand-off.
Weeks of heavy bombardments by forces loyal to Colonel Muammar Gaddafi failed to break the deadlock.
This is explained partly by the size of Misrata, Libya's third-largest city.
It is the only significant western rebel holdout, and is strategically important because of its deep-sea port, so rebels have fought hard to defend it.
They have a large pool of potential manpower. Many among the 300,000 population have hardened in their opposition to Col Gaddafi during what Western leaders have compared to a "medieval siege", residents say.
The rebels have a lifeline through the port, which has been fired on but has continued to receive supplies of food, medicine and reportedly arms, while serving as an evacuation point for the injured and for trapped migrant workers.
And they have local knowledge - one reason Col Gaddafi's forces may have been unwilling or unable to engage in decisive open battles.
"The rebels know the entrances and exits to the city very well, they know how to take cover," a medic who lives in Misrata told the BBC.
"[Col Gaddafi's forces] know that if they got stuck inside the city, they would be surrounded and totally eliminated."
The forces fighting for Col Gaddafi have been better equipped than the rebels, with access to heavy weapons, some basic military training, and none of the supply-line problems they face further east.
Yet the professionalism of the troops has been widely questioned and their numbers are limited.
The Libyan leader has kept his army weak, and his campaign has been led by a handful of brigades commanded by his sons, perhaps 10,000-15,000 men in total.
These are split between Tripoli, Misrata and the east. But Col Gaddafi is said to be reluctant to let even these supposedly "crack troops" operate in numbers greater than a few hundred, in case they desert.
Fighting in Misrata was first reported at the end of February, with an uprising swiftly countered by a military assault.
In the city centre, a front line was established along Tripoli Street. For weeks, dozens of pro-Gaddafi snipers backed by tanks occupied strategic points along the road, before rebels eventually isolated them, cutting off their resupply routes using lorries loaded with sand to form roadblocks.
The snipers were driven out of the Tameen (Insurance) tower - their last holdout and the tallest building in the area - in late April.
On Wednesday, rebels claimed to have pushed their opponents back to the west of the city along the coast.
But nor have the Misrata rebels been able to gain absolute control.
Though they are said to be better organised than those in eastern Libya, and have, for example, set up a network of makeshift arms factories, their campaign is still an improvised affair.
Denying government claims that militants inspired by al-Qaeda have been sent to help them, the rebels describe themselves as an improvised movement of civilians motivated by their anger at Col Gaddafi.
"Since the first days of this conflict, we [the rebels] are taking the defensive position and they are taking the attacking position - the weapons we have are just enough to defend the city," the Misrata medic said.
Ousted from the city centre, pro-Gaddafi forces have relied on long-distance bombardment from the periphery.
Though the attacks have not resulted in any military breakthrough, they have shut the city's normal life down and caused shortages and mounting casualties.
Rebels say that bombardments have been claiming 10-15 lives a day, with many more injured. The death toll rose sharply during the most intense battles last month.
One woman who fled Misrata when the fighting was at its heaviest said Tripoli Street was a "war zone" and accused Col Gaddafi's troops of abuses.
"There were corpses in the gutter and in the vegetable market where I buy produce," she told the UN humanitarian news service Irin. "The militia raped women, slaughtered men and killed children."
Government forces have sown anti-shipping mines off the harbour, used Russian-made Grad rockets to scatter anti-vehicle mines in the port, and set fuel storage tanks ablaze with missile strikes, according to rebels and human rights groups.
Pro-Gaddafi troops in civilian areas are also using Spanish-made cluster bombs, Human Rights Watch and other reports say.
The Grad rockets are fired in a dense and inaccurate pattern, while the cluster munitions - now banned by most countries - release high-velocity fragments and molten metal.
"I think that they are bombing at random and I think this is terrorising the people," said Paolo Grosso, an anaesthetist working at a clinic in Misrata for the Italian branch of the aid agency Emergency.
"They have no military target - they bomb anywhere to scare the population."
That is a picture that the Libyan government has challenged.
Moussa Ibrahim, a government spokesman, told BBC's Hardtalk that the government was trying to protect civilians from rebels, and that doctors in the city were "trying to give a bad image of Misrata" to encourage more direct Nato intervention.
Coalition air strikes have been reported around the edges of Misrata, but Western officials say they are not willing to risk civilian casualties by directing these within the city, despite loud rebel calls for more muscular Nato action.
"This is a government and a regime that's opted to use the tops of hospitals, of mosques, parking their tanks beside schools and hiding themselves behind men and women to makes sure that we do not attack them," Lt Gen Charles Bouchard, the head of Nato operations in Libya, told the BBC World Service.
"So when we talk about action, one has to be mindful of all of these factors."