The bloody chaos that has gripped Libya for almost a year may be reaching a climax. The country has been split in two. The government and the elected parliament, based respectively in Beida and Tobruk, control the east of the country and parts of the west. The capital Tripoli and the western coastal towns and their hinterland are still dominated by rebels. The rebel movement, which calls itself Libya Dawn, has scores of ill-disciplined militias. These are little better than armed gangs. They have, for instance, been responsible for much of the human trafficking, launching illegal migrants into the Mediterranean in rotten, overcrowded craft. It is estimated that so far this year, they have made something like $500 million from tens of thousands of wretched and abused migrants. Tripoli is controlled by a violent Muslim Brotherhood gang called the Nawasi Brigade, which has been infiltrated by the local offshoot of Daesh (the self-proclaimed IS). The real military muscle has been provided by militias from Misrata. Some of these men learnt their fighting during the 2011 revolutions that toppled Muammar Gaddafi. Misrata was the scene of bitter house-to-house fighting in which casualties were high. These veterans provided the backbone of Libya Dawn's efforts to take over the rest of the country. In particular earlier this year, Misratan fighters launched a surprise attack on government-held oil export terminals in the east. Local troops and guards managed to stem the advance but not before part of a tank farm at Sidra had been set ablaze. However, when Daesh seized the coastal town of Sirte, Gaddafi's old hometown, between the Misrata forces and Misrata itself, it was decided to abandon the oil terminal front. It is suspected that to do this, Misrata first cut a deal with the government not to pursue or continue air attacks against them. Now this week Misratan militias have announced a ceasefire and called for reconciliation. Within the town itself militias supporting the Muslim Brotherhood have been isolated. This has left the rest of the Libya Dawn rebels in an isolated position. A leading Muslim Brotherhood politician in Tripoli rushed out a statement endorsing Misrata's decision. However, the real feelings of the rest of the Libya Dawn leadership were better reflected by the controversial grand mufti Sheikh Sadeq Al-Ghariani who condemned as a heretic anyone who quit the fight against the government. With Misrata's defection, the Muslim Brotherhood remnants of the rebel movement would almost certainly collapse. Meanwhile, United Nations-sponsored peace talks are edging toward an agreement to form a government of national unity in which the House of Representatives, the parliament elected last June, would play a pivotal role. The draft accord calls for the withdrawal of all militias from towns and cities to be replaced by police and army. There is speculation that Misratan militias could be inducted into the security forces. This raises the possibility that Misrata could share the policing of Tripoli with their long-term rivals the Zintanis, whose forces have put themselves under the army's command. This might be a recipe for disaster. However, the Misratan militia responsible for pushing Zintanis out of Tripoli last summer and then destroying the international airport was one of the few Misratan formations that was closely linked to the Muslim Brotherhood. Libya's agony is not yet over, but maybe it is possible now to glimpse the end of its pain.