(Reuters) - Eight civilians were killed in an air strike near Tripoli on Monday, the U.S. ambassador said, as Libya's internationally recognized government pressed on with an assault to recapture the capital it abandoned to a rival faction last year.

Four years after NATO warplanes helped dislodge dictator Muammar Gaddafi, Libya has descended into chaos, with two rival governments fighting for control, both fielding armies of former rebel fighters and air forces that bomb rival territory.

The internationally recognized government has been based in the country's east since being driven out of the capital last August by an alliance of armed groups called Libya's Dawn, which has set up its own rival government and parliament.

On Friday, the eastern-based government announced an assault to recapture Tripoli, even as the sides are both attending U.N.-hosted peace talks in Morocco.

Western countries fear a total collapse of central authority in a country of 6 million people a short sail away from Europe. Islamist militants, including fighters who proclaim loyalty to al Qaeda or Islamic State, have taken advantage of the chaos to establish bases, attack oil fields and enter central regions.

Forces loyal to the eastern government claimed responsibility for the air strike in Tarhouna, a town south of Tripoli, saying they had hit a military base. They also said they shot down a jet flown by Libya's Dawn.

"Terrible news today from Tarhouna where eight innocent displaced Tawergha killed in air strikes," U.S. Ambassador Deborah Jones said in a tweet, referring to members of a minority group, thousands of whom were displaced after Gaddafi fell.

"This violence serves no one's interests," said Jones, who is based outside Libya since most diplomats were evacuated from Tripoli last year.

The eastern chief of army staff said in a statement its planes had hit a Libya Dawn barracks, not a Tawergha camp, demanding an apology from Jones.

But Mohamed al-Tarhouni, spokesman of the town's municipality, said nobody had been killed in the strike which he said had hit an empty farm near a camp of displaced Tawergha.

Jones and Louai El-Ghawi, an eastern lawmaker, said there were reports that several family members of a colonel opposed to Libya Dawn had been killed in Tarhouna in an apparent revenge attack, but details were unclear. The eastern chief of staff said Dawn supporters had killed eight members of the family.

Forces in the western Zintan region, where armed groups are allied to the eastern government, said they had shot down a Libya's Dawn jet trying to attack the local airport.

"Two pilots of the Dawn jet downed this morning have been found," said Omar Matooq, spokesman of Zintan airport. "One of them was found dead after suffering burns. The other pilot is alive and has been arrested."

An official in the Tripoli administration backed by Libya's Dawn said the plane had crashed due to a technical fault.

Western countries fear that the fighting could create more room for militants from Islamic State, who have claimed responsibility for several high-profile attacks since the start of this year, such as the storming of a Tripoli hotel which killed five foreigners and the beheading of Egyptian Copts on a beach.

The United Nations has been trying to persuade the rival governments to form a unity cabinet and agree on a ceasefire, but the fighting and internal divisions on both sides have undermined dialogue.

"There is a chance that we can make progress and have the first names for a unity government this week. It is going to be a difficult discussion," said U.N. Special Envoy Bernardino Leon.

The eastern government has allied itself with Khalifa Haftar, an army general who started his own war against Islamists in the east in May. It has accused Libya's Dawn of having ties to Islamists militants.