A soldier from the South Sudan army walks away from a vehicle in the capital, Juba, on Saturday. Goran Tomasevic/Reuters

President Barack Obama said Saturday that continued violence and militancy in South Sudan could cost the world's newest country the support of the United States and other nations.

Obama said South Sudan's leaders have a responsibility to protect its citizens and to help protect Americans, who came under fire hours earlier during an evacuation attempt.

Four American service members were injured Saturday when rebel gunfire hit U.S. military aircraft trying to evacuate American citizens in South Sudan from a remote region that has become a battleground between the country's military and renegade troops, officials said. All four American service members were reported to be in stable condition.

"This conflict can only be resolved peacefully through negotiations," the White House said in a statement Saturday. "Any effort to seize power through the use of military force will result in the end of longstanding support from the United States and the international community."

U.S. Secretary of State John Kerry called President Salva Kirr to urge the South Sudanese leader to avoid ethnic conflict, preserve the welfare of those fleeing the conflict and protect U.S. citizens there. Kerry was sending a special envoy to the region and told Kirr that South Sudan's challenges require leadership and political dialogue, the State Department said.

Air evacuation vehicles were heading to Bor, the capital of the state of Jonglei and scene of some of the nation's worst violence over the last week.

The U.S. military's Africa Command (AFRICOM) said the three fired-upon aircraft were "participating in a mission to evacuate American citizens in Bor."

"After receiving fire from the ground while approaching the site, the aircraft diverted to an airfield outside the country and aborted the mission," the statement said.

"The damaged aircraft diverted to Entebbe, Uganda, where the wounded were transferred ... and flown to Nairobi, Kenya for medical treatment," said a follow-up AFRICOM statement.

On Sunday, the State Department said the U.S. citizens in Bor had been safely evacuated to Juba, the capital of South Sudan, adding that it strongly recommends that Americans leave the counrty "immediately."

Meanwhile, the government's foreign minister told Al Jazeera that South Sudan's president is ready to begin talks "with any rebel group" as violence in the country escalates.

South Sudan's Foreign Minister, Barnaba Marial Benjamin, said Saturday, "our president agreed yes, indeed he is willing for talks with the main group. Why would the government not talk to people who were a part of the struggle?"