The UN Security Council unanimously passed a resolution giving Sudan and South Sudan only 48 hours to halt hostilities or face potential sanctions.
With Russia and China joining the growing calls for a halt to the growing border conflict, the 15-member council on Wednesday backed up African Union efforts to halt violence and get peace negotiations started.
The resolution endorses an African Union plan aimed at getting the two countries to step back from the brink of war and resolve their differences.
South Sudan responded by announcing a committment to abide by the UN's resolution and Sudan said it seeks peace with its southern neighbour and hoped the South would respond positively to African Union and UN resolutions for ending hostilities.
Deng Alor Kuol, the South Sudan's Minister for Cabinet Affairs, said his government "formally appreciates
the adoption of the resolution and state our solemn commitment to comply with its mandated provisions."
"My government is already committed to the cessation of hostilities and resumption of negotiations under the auspices of the African Union," Kuol said
"The government of Sudan confirms her own strategic calls to have peace between the two states and it hopes the government of South Sudan gives a positive reaction to the African and UN Security Council resolutions," the foreign ministry's spokesman, Al-Obeid Meruh, said in a statement.
Sudan's UN envoy earlier said that there could only be peace between neighbouring states when the south ends its support for rebel groups operating in Sudan.
Al Jazeera's Peter Greste, reporting from Juba, said the UN resolution sets up a specific "timetable" and lists the steps that must be taken by each side must take to avoid sanctions.
"[The resolution] is being welcomed buy the diplomats who have been watching it. They say it has the kind of teeth that might bring the two sides to the negotiating table," our correspondent said.
It condemned repeated cross-border violence between Sudan and South Sudan including troop movements, the South's seizure of the oil-rich town of Heglig and Sudan's aerial bombings in the South.
Though the resolution was unanimously voted in, both Russia and China had opposed talk of sanctions during negotiations on the resolution.
The US-drafted resolution calls on the neighbors, which separated last year, to "immediately cease all hostilities" and withdraw troops to their own territory.
It says they must give a written commitment within 48 hours to the African Union and the Security Council.
The council ordered the two sides to start peace talks within two weeks under the auspices of African Union mediators.
The resolution calls for negotiations to be concluded within three months by August on critical issues including arrangements on oil and payments, the status of nationals living in the other country, resolution of disputed border areas, demarcation of the border, and agreement on the final status of
oil-rich Abyei, an outstanding issue from the 2005 peace agreement.
If these negotiations fail to achieve agreement on any issues within three months, the resolution asks UN Secretary-General Ban Ki-moon, in consultation with the AU, to make detailed proposals on all outstanding issues within the following month.
The resolution threatens "additional measures" under Article 41 of the UN Charter - which allows for non-military sanctions - if either side fails.
Susan Rice, US ambassador to the UN, said Sudan and South Sudan have a long record of "promises made and promises broken."
South Sudan won independence from Sudan last year as part of a 2005 peace treaty that ended decades of war that killed 2 million people.
But the neighboring countries have been drawing closer to all-out war in recent weeks over the unresolved issues of oil revenues and their disputed border, sparking alarm and condemnation from the international community.
Source: Al Jazeera and agencies