By Ahmed Elumami and Feras Bosalum
BENGHAZI Libya (Reuters) - Libya hopes to hold a referendum on a new constitution in December, a committee said on Thursday, undeterred by a descent into chaos and violence that has forced the elected parliament to move hundreds of miles from the capital.
But in a reminder of the anarchy gripping the oil producer Islamist militants attacked the civil defense headquarters in Benghazi, while fighting erupted west of the capital Tripoli.
Western powers hope the constitution will help bridge at least some of the differences dividing the desert nation along tribal and regional lines more than three years after the toppling of veteran ruler Muammar Gaddafi in 2011.
The central government is unable to control the heavily armed former rebels who helped overthrow Gaddafi but now fight each other for dominance.
An armed group from the western city of Misrata took over the capital Tripoli, in western Libya, and set up its own government and parliament last month, forcing the elected House of Representatives to move to the eastern city of Tobruk.
Nonetheless, the body compiling a new constitution has continued working in the eastern town of Bayda and hopes to put a draft up for vote in December, its spokesman, al-Sadiq al-Serrsi, said.
"The commission predicts that the referendum on the constitution will be in December," he said, giving a time frame for the first time.
Serrsi said it would be a challenge to hold a vote given the ongoing violence. But Libya surprised the world by successfully staging a national election in June, despite militia fighting raging in parts of the country.
The Amazigh, or Berber, minority and radical Islamists have boycotted the constitutional committee but otherwise Libyans from all over the country voted to elect the body in February.
The volatile situation in Tripoli has been exacerbated by clashes in the eastern port city of Benghazi, where Khalifa Haftar, a former general from the Libyan army, has launched war on Islamist militants.
Late in the evening, members of the Islamist Ansar al-Sharia group attacked the headquarters of Benghazi's civil defense forces where ambulances are parked, military officials and residents said.
In the west, residents of the tribal Warshefana area southwest of Tripoli reported shelling. The Warshefana are allied to the Zintani forces, which were expelled from the capital by the Misrata forces.
Around 3,000 people have fled the area to escape daily shelling by the Misrata forces, a local Warshefana official said. There was no immediate comment from the Misrata brigades which have been trying to take the area for weeks.
To try to narrow differences between the warring factions, the new U.N. special envoy for Libya, Bernardino Leon, flew to Tripoli on Thursday in the first visit of a senior foreign official since the Misrata group seized the capital.
He had earlier visited Tobruk and Bayda, the main eastern cities still under government control.
The fighting and lawlessness have prompted most foreign countries and the United Nations to close their diplomatic missions.
A U.N. statement said Leon met members of parliament and other "influential and political actors" during two days of talks. It did not name them.
"We seek to have and see a legitimate parliament which everyone recognizes," Leon told a news conference broadcast by al-Nabaa television station, in comments that enraged the armed group that has helped set up a rival parliament.
The Misrata group has helped reinstate the old assembly, the General National Congress, after its takeover of the capital, refusing to recognize the new elected parliament.
GMC spokesman Omar Meridian told al-Nabaa Leon had not consulted the old assembly: "We, the GMC, condemn that the U.N. envoy ignored the only legitimate body in Libya, the General National Congress."
(Additional reporting by Ayman al-Warfalli; Writing by Ulf Laessing; Editing by Alison Williams and James Dalgleish)