An outbreak of fighting south of the Libyan capital which killed at least four people stopped on Tuesday after local elders agreed a ceasefire, Reuters journalists in the area said.

The conflict, a flare-up of an old rivalry between the provincial town of Zintan and the neighbouring El-Mashasha tribe, underlined the tension and insecurity in Libya after the overthrow of leader Muammar Gaddafi.

Reuters journalists in the town of Wamis, about 190 km (120 miles) from Tripoli, on Monday saw damage to buildings caused by rocket or artillery fire which local people said had been directed on their town from Zintan.

On a visit to the town on Tuesday, there was no sign of any fighting. A local leader, Ibrahim Masood, said a committee of elders the day before had agreed a ceasefire and the release of prisoners by both sides.

Our first aim is Libya and to stop the killing of Libyans, he said.

Two months after Gaddafi was captured and killed, Libya has become a cauldron of competing regional, tribal and other groups which often clash violently with each other. The fragile central government exerts little control over the groups.

Fighters from Zintan played a vital role in forcing Gaddafi's forces out of Tripoli. Militias from the town are now among the most powerful forces in the country.

The head of Zintan's town council said the clash with the El-Mashasha tribe was a misunderstanding. Officials in the town said members of the tribe had killed several residents of Zintan earlier this week.

One member of the tribe, Naser Belgasim, was in Wamis on Tuesday after being released from detention in Zintan under the terms of the ceasefire. He displayed bruises and welts on his body that he said were inflicted while he was in custody.

They (fighters from Zintan) stopped my car and then examined my identity papers, he said. They arrested me and gathered around me and started to beat me with their rifle butts.

They told me we are from Zintan and you are El-Mashasha and they started to beat me again.

(Additional reporting by Taha Zargoun in Tripoli; Writing by Christian Lowe; Editing by Louise Ireland)