(Misrata, Libya) - If anyone is surprised by the apparent killing of Moammar Gadhafi while in the custody of militia members from the town of Misrata, they shouldn’t be.

More than 100 militia brigades from Misrata have been operating outside of any official military and civilian command since Tripoli fell in August. Members of these militias have engaged in torture, pursued suspected enemies far and wide, detained them and shot them in detention, Human Rights Watch has found. Members of these brigades have stated that the entire displaced population of one town, Tawergha, which they believe largely supported Gadhafi avidly, cannot return home.

As the war in Libya comes to an end, the pressing need for accountability and reconciliation is clear. The actions of the Misrata brigades are a gauge of how difficult that will be, and Misrata is not alone in its call for vengeance. In the far west, anti-Gadhafi militias from the Nafusa Mountains have looted and burned homes and schools of tribes that supported the deposed dictator. Anti-Gadhafi militias from Zuwara have looted property as they demanded compensation for damage they suffered during the war.

The apparent execution of 53 pro-Gadhafi supporters in a hotel in Sirte apparently under control of Misrata fighters is a bad omen. It is up to the National Transitional Council to rein in all the militias and quickly establish a functioning justice system. The NTC should take control of the many makeshift detention facilities, expedite the return of displaced Libyans, and ensure the investigation, trial and punishment of wrongdoers acting in the name of vengeance. That includes Gadhafi’s killers if the evidence showed crimes were committed. The NTC, and its foreign backers, have comprehensively failed to start setting up a justice system — even in Benghazi, where they have been in charge since the spring.

Clearly the NTC is up against the passions of a nasty war. Misrata withstood a two-month siege at the hands of Gadhafi’s forces with near-daily indiscriminate attacks that killed about 1,000 of its citizens. The town’s main boulevard, Tripoli Street, is in ruins. Facades of public buildings and private homes collapsed from tank fire and are charred inside and out. The pockmarks of bullet holes disfigure construction everywhere.

The fierce fight for Misrata has left a penetrating bitter aftertaste. Misratans say they detest anyone who backed Gadhafi. They are not welcome in Misrata, even if the city and its environs was their home for generations.

The Misrata militia is focusing its greatest wrath on Tawergha, a town of about 30,000 people just south of the city. Both Misratans and Tawerghas say residents there were enthusiastic Gadhafi supporters. Hundreds of erstwhile civilians in that town took up arms to fight for him. Misratans say Tawergha volunteers committed rapes and pillaged with gusto, though Misrata officials decline to produce evidence of the alleged rapes, saying family shame inhibits witnesses and victims from coming forward.

In any event, Misratan militia members are venting their anger on all Tawerghas, who are largely descendants of African slaves. Most fled their town as Misratan fighters advanced there between Aug. 10 and Aug. 12.

Witnesses and victims we interviewed provided credible accounts of Misratan militias shooting and wounding unarmed Tawerghas and torturing detainees, in a few cases to death. In Hun, about 250 miles south of Misrata, militias from Benghazi have taken it upon themselves to protect about 4,000 refugees. They say Misratans are hunting down Tawerghas.

One hospitalized Tawergha told Human Rights Watch how he was shot in the side and leg and abandoned to die near Hun: “They left us at the edge of the road, put a blanket over us and then started swearing, ‘You are dogs, hope you die.’”

Misrata militias, with the momentary compliance of local officials, insist that no Tawerghas should return to the area. Ibrahim Yusuf bin Ghashir, a representative of the NTC, said: “We think it would be better to relocate them somewhere else.” The allegations of rape, he added, “cannot be forgiven and it would be better to resettle them far away.”

This unforgiving campaign is not limited to Tawerghas. Many Misratans say that any tribe or group that supported Gadhafi — thousands of people — should not return to the city. The graffiti on tumble-down town walls express Misratans’ view: “(Expletive) No returnees.”

Human Rights Watch has interviewed refugees from Misrata who tried to return and were forbidden to enter the city without a permit from the local council. A Misrata militia member told the media that all pro-Gadhafi travelers are barred from the city.

As painful as the losses have been for Misrata and the rest of Libya, everyone who fought Gadhafi should remember what they were fighting for: an end to torture, to arbitrary detention, to pitting one tribe against another; for respect and equality among neighbors. Otherwise, the agony that preceded victory will breed vengeance, rancor and a divided new Libya — one that in disturbing ways may resemble the old.

Daniel Williams is a Senior Researcher at Human Rights Watch