NAIROBI (Reuters) - South Sudan’s army has captured the main rebel stronghold of Pagak near the Ethiopian border, forcing thousands of people to flee, the rebels said on Monday.

Rebel spokesman Lam Paul Gabriel said rebel forces pulled out of Pagak after coming under attack in the early hours of Sunday.

“We realised it would be costly for civilians and our forces have withdrawn,” Lam told Reuters.

Pagak, deep in the heartland of South Sudan’s Nuer people, one of its main ethnic groups, has been at the center of rebel operations since 2014.

The government’s attempts to take it began July, forcing aid workers to evacuate and the West to condemn the assault as a “clear violation” of a ceasefire declared in May by President Salva Kiir, an ethnic Dinka.

Despite the set-back, Lam said the fall of Pagak did not mean the end of the Nuer’s struggle against South Sudan’s Dinka-dominated government and security forces.

“Taking the headquarters is not the end of war,” Lam said.

Both sides had sustained casualties, he added. A government spokesman did not comment.

South Sudan descended into civil war in 2013, only two years after independence, when Kiir fired his Nuer deputy, Riek Machar, unleashing a conflict that has since splintered along multiple ethnic lines.

Machar has been under house arrest in South Africa since December under an attempt by regional leaders to bring about an end to the conflict.