Secretary of State John F. Kerry and Angolan Foreign Minister Georges Rebelo Chicoti speak to the media Monday after meetings in Luanda. (Pool/Reuters)

Secretary of State John F. Kerry said Monday that peace talks between the government and rebels in South Sudan are the only way to resolve rising violence there, even as renewed warfare broke out.

“We encourage both leaders to take advantage of this moment to try to make peace for their people,” or suffer economic sanctions and other consequences if they fail to do so, Kerry said, three days after he said the two sides could begin talks as soon as this week.

South Sudan’s army said early Monday that it overran a rebel base in Nasir and retook the key oil hub of Bentiu, news agencies reported. But the rebels launched a counteroffensive shortly afterward, and heavy fighting was reported. Bentiu was the site of a massacre last month that spurred outside efforts such as Kerry’s to prod the government and the rebels to the peace table.

State Department spokeswoman Jen Psaki condemned what she called a violation of a cease-fire agreement that both sides signed in January but have repeatedly breached.

“The parties need to recognize they signed a cessation-of-hostilities agreement, both of them, and the international community is prepared to take steps to see that that is honored,” Kerry said.

He spoke during a visit to Angola, his last diplomatic stop on an Africa tour that was dominated by the worsening violence in U.S.-backed South Sudan. The United States was instrumental in helping the world’s newest nation come into being three years ago and is a major donor to South Sudan.

The military offensive came three days after Kerry went to South Sudan for emergency talks with President Salva Kiir. Kerry emerged from the talks Friday to say that Kiir had promised to abide by the terms of the cease-fire and to participate in negotiations sponsored by neighboring Ethiopia. Kiir said Friday that he was willing to talk.

But a spokesman for rebel leader Riek Machar’s negotiating team in Ethiopia told the Associated Press on Monday that Machar first wants a “program” that includes a timeline for the formation of a transitional government as well as its composition and structure. Machar spoke to Kerry by phone on Friday but would not commit to talks.’

Machar, South Sudan’s former vice president, has been locked in a battle with Kiir since December, when political tension between the two boiled over into open warfare. The violence is increasingly becoming an ethnic contest between Kiir’s Dinka community and Machar’s Nuer people.

“The Americans are pushing us to go to Juba and form an interim government,” said the spokesman, Yohanis Musa Pouk, referring to the South Sudanese capital. “We cannot go there without an agreement on a program first. We need to know who will be in that transitional government, in what capacity, for how long and issues like that.”

In Ethiopia, meanwhile, South Sudan’s government and rebel negotiators signed a document pledging to open safe-travel corridors for aid workers, AP reported. The agreement also urged the sides to recommit to the January peace deal.

In a weekend interview in South Sudanese news media, Machar appeared to dismiss peace talks.

Kerry said he had seen the comments but insisted Monday that Machar is not ruling out talks under the auspices of Ethiopia’s prime minister. Kerry said Machar had assured the Ethiopians he would come.

“He has a fundamental decision to make,” the top U.S. diplomat said of Machar.

“We have a number of different options available to us, “ Kerry said. “We have said we are serious and there will be accountability and implications if people do not join into this legitimate effort.”

He said he discussed the crisis Sunday with U.N. Secretary General Ban Ki-moon, who he said plans to go to Juba on Tuesday. The U.N. Security Council is considering sanctions against both sides in the conflict, as is Washington.

The United States is also pushing for an expanded African military force to separate the warring sides and keep peace. The troops would operate under the auspices of the United Nations.

South Sudan is teetering on the brink of a civil war and is at risk of widespread famine if fighting does not end quickly, the United Nations and other outside organizations have warned.

Thousands have been killed, mostly civilians, and more than 1 million people have been displaced by the violence.