JUBA (Reuters) - South Sudan’s rebels have claimed responsibility for an ambush on a convoy of buses and other vehicles traveling on a major highway that killed at least 14 people, the opposition said on Friday.

Gunmen attacked the convoy as it drove towards Juba on a highway linking the South Sudan capital with Nimule, on the southern border with Uganda.

Rebel troops were targeting government troops although civilians were killed in the crossfire, opposition spokesman Lam Paul Gabriel told Reuters, warning the public not to travel with soldiers.

“We are taking the responsibility (for) the ambush. We targeted government groups, those who are escorting the civilians,” Gabriel said, adding that all the government vehicles in the convoy were destroyed.

Gabriel said its fighters killed 40 people, including at least two colonels, in an attack that included the use of rocket-propelled grenades.

But South Sudanese police spokesman Daniel Justin Boulogne said 14 people had been killed, without giving details of whether they were soldiers, civilians or both.

South Sudan has been devastated by a three-year civil war that broke out in December 2013 after President Salva Kiir sacked his political foe and vice president Riek Machar.

The two men hail from rival ethnic groups.

A regionally brokered peace deal was signed in 2015 but mistrust and tensions between the two men and their forces festered, exploding into fresh fighting in July last year.

The war has uprooted about a quarter of the population, ruined the economy and caused a famine in some regions.