By Marie-Louise Gumuchian
TRIPOLI, May 8 (Reuters) - Several people were killed on Tuesday when an armed militia protesting outside the Libyan prime minister's office in Tripoli started shooting, highlighting the country's volatility a month before it holds its first election.
Witnesses and officials said the militia, from the town of Yafran about 100 km (60 miles) southwest of Tripoli, was at the prime minister's compound to demand cash from the government when the protest turned violent.
Adel Osman, a spokesman for the Defence Ministry, said there were dead and injured, but he did not know how many. A security guard inside the building told a Reuters reporter he believed four people were killed.
"It's calmed down," the guard said. "They came and they were protesting ... We told the women to leave the building (when the clashes started). The men stayed."
The guard said interim Prime Minister Abdurrahim El-Keib was at a meeting elsewhere when the shooting happened.
Earlier, Reuters reporters outside the compound, a short distance from Tripoli city centre, heard sporadic bursts of gunfire, including from large-calibre weapons.
Security forces cordoned off the area and ambulances could be seen. After about 30 minutes the shooting died out and the cordon was lifted. Journalists were allowed into the building for a scheduled news conference.
The prime minister's office is frequently the focus of protests by disgruntled militias demanding cash or jobs in recognition of the role they played in last year's revolt to oust Muammar Gaddafi.
Many of the militiamen are armed and occasionally their protests turn violent. Tuesday's clashes were the first time fatalities had been reported from a protest at the compound.
Libya is due to hold its first free election next month to choose an assembly to draft a constitution. People have started to register to vote, a novelty in a country where Gaddafi banned elections for 40 years.
There is a risk that the lack of security will jeopardise the election. The government is struggling to assert its authority over dozens of militias who refuse to disarm and take orders only from their own commanders. (Additional reporting by Ali Shuaib; Writing by Christian Lowe; Editing by Janet Lawrence)