Libyan rebels put their best troops in to battle Muammar Gaddafi's forces for the eastern oil town of Brega on Sunday while Western warplanes flew overhead and the sound of explosions ripped through the air.
Libya's civil war is in danger of getting bogged down in a stalemate as neither Gaddafi's troops, tanks and artillery, nor the chaotic rebel force is able to gain the upper hand, despite Western air power effectively aiding the insurgents.
The rebels are, however, attempting to put their house in order, naming a "crisis team" with Gaddafi's former interior minister as the armed forces chief of staff, to try to run parts of Libya it holds and reorganising their military forces.
Outside Brega, better rebel discipline was already in evidence on Sunday with the less disciplined volunteers, and journalists, kept several kilometres (miles) east of the front. The insurgents have also deployed heavier weapons.
As warplanes flew over, the sound of explosions and machinegun fire came from the town, a sparsely populated settlement spread over more than 25 km (15 miles), but it was not clear if the jets had bombed government positions.
Without the backbone of regular forces, the lightly-armed volunteer caravan has spent days dashing back and forth along the coast road on Brega's outskirts, scrambling away in their pick-ups when Gaddafi's forces fire rockets at them.
The enthusiastic volunteers tend to get on well with the rebel army, made up of soldiers who defected to the rebels, but a small scuffle broke out near Brega's eastern gate on Sunday as a soldier berated them for their lack of discipline.
"These revolutionaries go in and fire and that's it. They don't have any tactics, these guys. They cause problems," said the soldier, Mohammed Ali.
The rebels say they now are restructuring their forces to end the pendulum swing of euphoric advance in the wake of Western air strikes followed by headlong retreat in the face of government artillery.
"We are reorganising our ranks. We have formed our first brigade. It is entirely formed from ex-military defectors and people who've come back from retirement," former Air Force Major Jalid al-Libie told Reuters in Benghazi.
Asked about numbers, he said he could not reveal that, but added: "it's quality that matters".
The aim was for the trained force to steel resistance of the many volunteers so the rebel army could hold ground.
The rebel leadership called for Nato-led air assaults to continue despite 13 rebel fighters being killed in a strike as they tried to take control of Brega.
Nato has conducted at least 547 sorties since it took over command of Libya operations on March 31, including more than 200 intended as strike missions, but has not confirmed hitting any targets. It also has 21 ships patrolling the Mediterranean Sea to enforce an arms embargo mandated by the United Nations.
A Reuters correspondent visiting the scene of the air strike saw burnt-out vehicles, including an ambulance, by the road near the eastern entrance to Brega. Men prayed at freshly dug graves covered by rebel red, black and green flags nearby.
Most blamed a Tripoli agent for drawing the "friendly fire".
But some gave a different account. "The rebels shot up in the air and the alliance came and bombed them. We are the ones who made the mistake," said a fighter who did not give his name.
While fighting in the east risks stalemate, in the west Gaddafi's forces are besieging the city of Misrata, shelling a building that had been used to treat wounded, a resident said, killing one person and wounding more.
Misrata, Libya's third city, rose up with other towns against Gaddafi's rule in mid-February, but it is now surrounded by government troops after a violent crackdown put an end to protests elsewhere in the west of the country.
Doctors say hundreds have been killed in Misrata despite two weeks of Western airstrikes meant to stop killing of civilians.
A doctor who gave his name as Ramadan told Reuters by telephone from the city that 160 people, mostly civilians, had been killed in fighting in Misrata over the past seven days.
Ramadan, a British-based doctor who said he arrived in Misrata three days ago on a humanitarian mission, had no figure for the total toll since fighting began six weeks ago.
"But every week between 100 or 140 people are reported killed - multiply this by six and our estimates are 600 to 1,000 deaths since the fighting started," he said.
After weeks of shelling and encirclement, Gaddafi's forces appear to be gradually loosening the rebels' hold on Misrata. Rebels say they still control the city centre and the port, but government troops have pushed into the centre.
One Benghazi-based rebel said food supplies were acutely low in Misrata. "There are severe food shortages and we call on humanitarian organisations to help," said the rebel called Sami, who said he was in regular contact with a Misrata resident.
Some supplies are getting through the rebel-held port though, and a Turkish ferry, kitted out as a hospital ship, evacuated 250 wounded along with 100 care workers from Misrata on Sunday, Turkey's state-run Anatolian news agency said.
The ship is bound for Benghazi, where a further 100 patients were waiting to be picked up, along with 30 Turkish and 40 foreign citizens, and brought back to Turkey, Anatolian said. The ferry had to wait off Misrata for five days due to clashes.
Accounts from Misrata cannot be independently verified because Libyan authorities are not allowing journalists to report freely from the city, 200 km (130 miles) east of Tripoli.
Gaddafi's troops are also mopping up resistance in the mountainous southwest of Tripoli.
Government forces shelled the small town of Yafran, southwest of the capital on Sunday, killing two people, Arabiya television reported, quoting a witness.
They also shelled the city of Zintan, about 160 km (100 miles) southwest of the capital, a resident said.
"Gaddafi's brigades bombarded Zintan with tanks in the early hours on Sunday. There has been random bombardment of the northern area (of Zintan). They are still besieging the town," the resident, called Abdulrahman, told Reuters.