Juba, South Sudan (CNN) -- U.S. President Barack Obama said Thursday that South Sudan "stands at the precipice," as deadly clashes spread in Africa's newest nation.
He spoke out the same day government officials said rebels have taken the town of Bor.
The town, which lies about 200 kilometers (125 miles) north of the capital, Juba, was under heavy shelling, said Col. Philip Aguer, an army spokesman. Bor Mayor Mhial Majak Mhial said the town was under rebel control and heavy artillery was in use.
"In 2011, millions of South Sudanese voted to forge a new nation, founded on the promise of a more peaceful and prosperous future for all of South Sudan's people," Obama said in a statement. "In recent years, against great odds, South Sudan has made great progress toward breaking the cycle of violence that characterized much of its history.
"Today, that future is at risk. South Sudan stands at the precipice. Recent fighting threatens to plunge South Sudan back into the dark days of its past," the President said.
Amid violence this week, Obama sent 45 U.S. service members to South Sudan. In a letter to Congress, he said the troops were deployed "to support the security of U.S. personnel and our Embassy."
The State Department said earlier this week that U.S. citizens currently in South Sudan should leave immediately, and it ordered the departure of non-emergency U.S. government personnel.
Obama stressed that leaders in South Sudan have a choice.
"South Sudan's leaders must recognize that compromise with one's political enemy is difficult; but recovering from unchecked violence and unleashed hatred will prove much harder," he said.
The fighting has been spreading in South Sudan after a reported coup attempt in Juba over the weekend. President Salva Kiir has blamed soldiers loyal to his former vice president, Riek Machar, for starting the violence.
"The government has lost control of Jonglei state to the forces of Col. Machar and his group," government representative Ateny Wek Ateny told CNN, referring to the state where Bor is situated.
The government could not yet confirm the number of fatalities from the violence, but "casualties are in the hundreds, including army forces and civilians," Ateny said.
The government tweeted that its troops had lost control of Bor and that it was doing all it could to "make sure citizens are secure & safe."
Earlier, Joseph Contreras, acting spokesman for the U.N. mission in South Sudan, told CNN the situation in Bor was "still unstable."
The violence, which the government said Wednesday has killed about 500 people, began Sunday evening.
In an interview with the online Paris-based Sudan Tribune published Wednesday, Machar denied Kiir's claims that he was behind an attempted coup, saying: "There was no coup. What took place in Juba was a misunderstanding between presidential guards within their division."
Kiir told reporters Thursday he was ready for dialogue "with anyone who is willing."
Attack on U.N. base
Also Thursday, unknown assailants attacked a U.N. base in South Sudan, possibly killing or injuring civilians who had sought refuge from the fighting.
The attack happened on the U.N. Mission in South Sudan (UNMISS) base in Akobo.
"There are indications that civilians may have been killed and wounded in the attack, but this remains to be verified. Should these reports prove true, those responsible must be held accountable for their crimes," read a U.N. statement.
At the time of the attack, 43 Indian peacekeepers, six U.N. police advisers and two U.N. civilian staffers were present at the base. UNMISS has more than 6,800 troops and police in the country.
The deepening crisis has alarmed South Sudan's neighbors, prompting African nations to send mediators.
The African Union said the team was made up of ministers and high-level officials from Ethiopia, Kenya, Uganda and other countries -- the first major peace initiative since clashes first erupted.
Tensions have been high in South Sudan since Kiir dismissed his entire Cabinet, including Machar, in July. The move further inflamed deep tensions between Kiir's Dinka community and Machar's Nuer community.
U.N. officials have said they are worried the recent fighting is based on ethnic divisions.
Citing reports it had received, Human Rights Watch said Thursday that in the fighting in Juba, South Sudanese soldiers fired indiscriminately in highly populated areas and targeted people for their ethnicity.
According to witnesses and victims, soldiers specifically targeted people from the Nuer ethnic group, it said, adding that it had also received reports that Nuer soldiers may have targeted ethnic Dinka in Juba and in the town of Bor.
"The awful accounts of killings in Juba may only be the tip of the iceberg," Daniel Bekele, Africa director at Human Rights Watch, said in a statement.
"Government officials -- whatever their politics -- need to take urgent steps to prevent further abuses against civilians and quickly deescalate rising ethnic tensions. ... We are deeply concerned that ethnically-based attacks on all sides will lead to revenge attacks and more violence."
It was not immediately possible to independently verify the reports. Government officials have disputed that the fighting is along ethnic lines.
Information Minister Michael Makuei Lueth said Wednesday that people from different states and tribes rose up against the government, which is now fighting back.
Eleven people have been arrested in connection with the foiled coup, according to a statement the South Sudan government posted Thursday. Two of them were from the Nuer community, it said.
Tens of thousands displaced
Up to 100,000 people have been displaced by the fighting so far, according to Defense Minister Gen. John Kong Nyuon.
Many of the displaced people have crossed the Nile River, he said, adding that he feared a humanitarian disaster was unfolding.
On Wednesday, South Sudan's Ministry of Foreign Affairs said order had been restored in the country, adding that government forces were in charge and flights had resumed at Juba International Airport.
U.N. officials have expressed deep concern about the unrest, saying as many as 35,000 people have taken shelter at the organization's compounds.
The U.S. and Britain have both sent planes to airlift their nationals out of the country.
U.N. Secretary-General Ban Ki-moon has been reaching out to key leaders seeking a political end to the crisis. The U.N. Security Council has urged all parties to immediately cease hostilities and exercise restraint to prevent the further spread of violence.
South Sudan formally split from Sudan in 2011 after a referendum, following decades of conflict. Numerous armed groups remain active in the oil-rich country.
CNN's Aliza Kassim, Nana Karikari-apau and Anna Maja Rappard contributed to this report.