Sudan and South Sudan have accused each other of opening up a new front along their disputed border, raising fears of all-out war.
The clashes broke out north of Aweil in South Sudan, about 100 miles (160km) west of the Heglig oil field, scene of most recent fighting.
Seven South Sudanese soldiers and 15 Sudanese were killed, South Sudan’s army spokesman said.
South Sudan seceded last year but its border with Sudan has not been agreed.
On Tuesday, envoys told the UN Security Council that Sudan and South Sudan were now “locked in logic of war”.
The latest fighting was sparked by the shooting dead of a South Sudanese soldier when he went to collect water on Tuesday night, South Sudan’s army spokesman Col Philip Aguer said.
It happened on the road between Aweil and Meiram in Sudan’s Darfur region at a village known by southerners as Agok and by Khartoum as Bahr al-Arab camp.
Sudan’s government has not commented but Col Fathi Abdalla Arabi, the mayor of Meiram, confirmed the fighting to the Sudanese Media Center website, which has close links to the government.
Most recent fighting has centred on Heglig – and the spread of fighting further along the border is of great concern, says the BBC’s James Copnall in Khartoum.
Juba sent its forces into the oil field last Tuesday, saying it was responding to air and ground attacks by Sudan.
The UN and the African Union have demanded South Sudan’s unconditional withdrawal from Heglig, calling its occupation “illegal and unacceptable”, but they have also condemned Sudan for carrying out aerial bombardments of the South.
They are considering imposing sanctions against both sides.
Heglig, which used to provide more than half of Sudan’s oil, is internationally accepted to be part of Sudanese territory – although the precise border is yet to be demarcated.
AU mediator Thabo Mbeki and UN envoy Haile Menkarios told a closed-door Security Council meeting that hardliners were in control of governments in both Khartoum and Juba.
South Sudan gained independence after a two-decade civil war with the north and is now run by the former rebel movement.
The difficult history between the two countries cannot be disregarded – and it could prove difficult for both to move away from a mentality of war, our correspondent says.