KAMPALA, Uganda -- Long before South Sudan achieved its hard-fought independence, the United Nations was here, feeding its hungry, sending in doctors to fight disease and steering the vast, destitute region toward its goal of self-governance and self-determination.
But instead of gratitude and comity, the relationship between the United Nations and the young country it helped midwife into existence two years ago has evolved into one characterized by growing distrust on both sides. South Sudan, meanwhile, has become one of the most dangerous theaters of operations for the United Nations.
The relationship has taken on added urgency as ethnic clashes have fueled a growing crisis in the restive Jonglei State.
In April, seven United Nations employees and five Indian peacekeepers working for the body were killed in an ambush in Jonglei by armed men identified by the South Sudanese as antigovernment rebels.
Last December, South Sudan's military shot down a United Nations helicopter, killing all four Russian crew members in what officials in the South Sudanese capital of Juba later said was a result of miscommunication.
United Nations personnel, including the former human rights chief there, have been detained and even beaten up by security agents, while equipment has been impounded. A human rights researcher for the body was expelled from the country last year and, after an anticorruption campaign, a special presidential adviser hired by the United Nations mission fled after receiving death threats.
In late June, a report by the United Nations secretary general said that there had been seven cases of arrest and detention, one assault and one illegal seizure of property involving staff members of the mission since the last report in March.
"Until January of last year, politically the government in Juba saw the U.N. as an ally -- that is no longer the case," said an adviser to both the United Nations and the South Sudanese authorities, speaking on the condition of anonymity to avoid alienating either side.
Myriad United Nations agencies operate in South Sudan, helping to improve literacy, road access, health and more, but it is South Sudan's relationship with the body's peacekeeping mission itself, the adviser said, that is growing increasingly tense and has been punctuated by heated discussions.
The question now is whether the episodes have simply been evidence of the risks that come with operating in a country that is heavily armed and unstable after decades of civil war or evidence of something more volatile, even a growing sense of enmity.
South Sudanese officials increasingly question whether the world body is on their side, with earlier support for independence turning to criticism of the young government's record on human rights and continuing confrontation with neighboring Sudan, from which South Sudan seceded.
The situation today stands in stark contrast to the heady optimism that followed South Sudan's independence in July 2011. Days of celebration led to the sobering reality of trying to govern the country, Africa's newest and one of the least developed in the world.
After decades of civil war and neglect by rulers in Sudan, landlocked South Sudan has few paved roads and little industry to speak of aside from the oil production upon which it depends for revenue. Largely rural, the country has a very young and very poor population estimated to be around 11 million, divided into more than a dozen ethnic groups.
Sudan and South Sudan each accuse the other of waging a proxy war by arming rebels groups. Conditions are particularly dire in Jonglei, a large, swampy territory where ethnic conflict is keeping at least 100,000 civilians from receiving aid.
"The fighting is threatening the lives of ordinary people and has reduced the ability of humanitarian organizations to provide urgently needed help," Valerie Amos, the United Nations' under secretary general for humanitarian affairs, said in a statement last week. She called on all parties to "create the necessary security environment conducive for aid delivery."
The administrator of the United States Agency for International Development, Rajiv Shah, said in another statement last week that the United States was "gravely concerned by the serious escalation of the humanitarian crisis in Pibor County in South Sudan's Jonglei State" as a result of the violence there.
The situation is complicated by the fact that South Sudan's security personnel are a confusing mixture of soldiers, militia members and police and intelligence officers, widely considered undisciplined and violent. In 2011, police officers assaulted the leader of the United Nations human rights division in South Sudan, who had to be hospitalized. Humanitarian groups have complained about security forces' hijacking aid convoys.
South Sudanese say that for all the assistance channeled to the impoverished country, the wealth of the aid industry does not reach the national economy. They also say that foreign officials are hired without checking with the government, breeding tension, and that the United Nations does not alert the military to peacekeeper movements. The United Nations has failed to protect civilians and its mandate is overreaching, they contend.
Perhaps most damaging to the relationship is the impression that the peacekeeping mission has turned its back on the South Sudanese in their simmering conflict with Sudan.
"It seems like they are favoring Khartoum," said Ben Majok, a former South Sudanese soldier in Rumbek, a city in central South Sudan.
The United Nations says it is losing tolerance for South Sudan's human rights record, and warns that the growing threats to the security of its staff are obstructing its work. The body's current mandate in South Sudan, described in its budget as "political transition" and "extension of state authority," is completely different from what it was during Sudan's civil war.
The South Sudanese are "looking for a mission that would protect them from enemies," according to the United Nations' peacekeeping chief in South Sudan, Hilde F. Johnson.
It is not unprecedented for the United Nations to clash with local residents and officials. In the Democratic Republic of Congo, residents have hurled stones at United Nations convoys, accusing the body of incompetence. In Haiti, civilians have attacked peacekeepers over fears that they brought disease and did not do enough to improve the country. In Kashmir, where a United Nations mission has been operating for more than 50 years, politicians have asked the peacekeepers to leave.
Despite the tense relationship in South Sudan, officials on both sides are trying to continue forward. South Sudan's minister of information insists that relations remain smooth. Ms. Johnson said that risk was something peacekeeping missions "have to live with," but that there had been "incidents we didn't expect."
The peacekeeping presence in South Sudan is older than the republic itself, which Ms. Johnson once referred to as "still a toddler by every measure," and has been acutely intertwined with the history of the nation's birth.
Within months of independence, the relationship between the government and the United Nations was put to the test. First, South Sudan shut down oil production, then accounting for roughly 99 percent of national income, over a disagreement with Sudan. Then South Sudan's army invaded Sudanese oil fields, which they claimed were in disputed territory.
Rather than receiving the support they had become accustomed to, South Sudanese forces got a strongly worded demand from the United Nations mission to withdraw. One private consultant with South Sudan's government called it a moment of reckoning for South Sudan. The relationship has been slowly deteriorating ever since.
By June 2012, when the mission's mandate was up for renewal, Vice President Riek Machar wrote to the United Nations requesting that the mission be downgraded, calling the mandate "no longer appropriate."
That same month the United Nations published a report claiming that South Sudan's military had committed widespread abuses in Jonglei in an effort to disarm civilians there. The government in Juba condemned the report as one-sided. In November, a human rights officer researching atrocities in Jonglei was expelled from the country.
The attack on the United Nations helicopter in December "rendered aerial reconnaissance for early warning purposes impossible," the office of the secretary general warned in a report in March, and "restricted the capacity to react to incidents in a timely manner."
Josh Kron reported from Kampala, and Nicholas Kulish from Nairobi, Kenya.
This article originally appeared in The New York Times.