South Sudan’s president agreed on Friday to meet with his rival as soon as next week to jumpstart peace talks that have been stalled for months and, potentially, lay groundwork for a new government to bring the world’s newest nation out of bloodshed.

U.S. Secretary of State John Kerry met for about 90 minutes with President Salva Kiir in his office compound in the capital Juba and emerged to announce a tentative agreement for the peace talks as early as next week in Ethiopia. The prime minister of Ethiopia, Hailemariam Desalegn, has agreed to mediate the talks.

Kerry said Mr. Kiir’s rival, the former vice president-turned-rebel Riek Machar, has previously indicated he would engage in cease-fire discussions. The American diplomat said he hoped to speak to Mr. Machar later on Friday.

“The unspeakable human costs that we are seeing over the course of the last months, and which could even grow if they fail to sit down, are unacceptable to the global community,” Mr. Kerry told reporters after his meeting with Mr. Kiir. “Before the promise of South Sudan’s future is soaked in more blood, President Kiir and the opposition must work immediately for cessation of hostilities and to move toward an understanding about future governance for the country.”

Mr. Kerry said a cease-fire would likely lead to a transitional government in South Sudan but declined to comment on whether Mr. Kiir or Mr. Macher could have a role in the country’s future leadership.

If the peace talks happen, they would mark a turning point in nearly six months of horrific fighting that has largely broken down along ethnic lines between rival Dinka and Nuer tribes. The violence has been compared to the threat of genocide, and could also lead to famine later this year since farmers among the nearly one million South Sudanese who have fled their homes have had to abandon their crops.

Thousands have been killed in the fighting, which began when Mr. Kiir, a Dinka, accused Mr. Machar, a Nuer, of plotting a coup to seize power last December.

An earlier cease-fire agreement, reached last January, was abandoned within days.

If Mr. Kiir and Mr. Macher fail to move strongly to curb the violence, or if other fighters continue to violate human rights and disrupt humanitarian aid, Mr. Kerry said they would be held accountable. The consequences would range from economic sanctions to, potentially, prosecution by international courts.

African nations are willing to deploy between 2,500 and 5,500 troops initially for peacekeeping missions under the auspices of the United Nations. That would require a new U.N. mandate.

The U.S. and U.N. have threatened to bring sanctions against militants on both sides of the fighting including, potentially, Mr. Kiir and Mr. Machar themselves. And Western officials are trying to persuade the African Union to deploy thousands of troops to South Sudan to keep the peace.

More In: World | International | News