Fighting has broken out in South Sudan's Upper Nile state, officials say, in the first major clashes since the government and rebels signed a ceasefire agreement in January.
Both sides have accused each other of starting the violence in Malakal, the capital of Upper Nile state.
The government says there has been fighting in most parts of the town.
The clashes will again fuel concerns over the security of oilfields in the north - the backbone of the economy.
The UN representative in the capital, Juba, urged all parties in the world's newest country to protect civilians.
"Hostilities have this morning broken out in Malakal: All parties engaged in the violence must uphold people's rights and protect non-combatants," UN humanitarian co-ordinator in South Sudan Toby Lanzer tweeted.
Mr Lanzer told the BBC earlier this month that $1.3bn (£790m) was needed to deal with the South Sudan crisis.
Presidential spokesman Ateny Wek Ateny told the BBC that the rebel attack had begun at 07:50 local time (04:50 GMT).
"The rebels are using assault rifles - AK-47. And they have some RPGs [rocket-propelled grenades] and a number of other machine-guns. They are well-equipped," he told World Update on the BBC World Service.
But the rebels' military spokesman, Brig Gen Lul Ruai, accused the government forces, with the support of the Ugandan army, of attacking their positions south and east of the oil town.
He told the BBC that the Ugandan forces had bombed their positions from air and that the rebels had repulsed the attack.
Uganda has denied involvement and says it is withdrawing some of its troops, which are aligned to South Sudan President Salva Kiir, from the country.
Upper Nile administration spokesman Philip Jiben told Reuters news agency the fighting was continuing, but government forces were "still in control of Malakal".
President Kiir's government and rebels who support Mr Machar have each accused the other of violating the 23 January ceasefire that was brokered by neighbouring East African states.
Malakal - a dusty market town which serves as the gateway to the oilfields of the Upper Nile region - has been at the centre of clashes and has repeatedly changed hands.
Last month the army said that it had recaptured the town after days of heavy fighting.
Mr Machar says he controls all anti-government forces, but analysts say that the loyalty of some of them is questionable and some are pursuing their own agendas.
The UN says about 860,000 people have fled their homes since the conflict began on 15 December.
What started as a political dispute between Mr Kiir and Mr Machar escalated into full-scale conflict and thousands have been killed.
Although both men have supporters from across South Sudan's ethnic divides, fighting has often been communal, with rebels targeting members of Mr Kiir's Dinka ethnic group and government soldiers attacking Nuers, the group from which Mr Machar hails.
The BBC's Anne Soy says the ceasefire was agreed after talks in neighbouring Ethiopia but the fighting in Malakal is likely to further complicate the negotiations.
The second phase of talks got off to a shaky start last week over uncertainty about the participation of seven prominent politicians released from custody by South Sudan's government, she says.
They were part of a group of 11 of Mr Machar's allies detained after what the authorities allege was a "coup attempt" in December - another four of the detainees remain in custody in Juba facing treason charges. They all strongly deny the charges.