South Sudanese troops captured the town last week because they claim Sudan was using it as a base from which to launch attacks.
Khartoum, the capital of Sudan, claims that they actually retook the town after a fierce battle. The dispute over the border town is one of many that has taken place during a decades-long struggle between Sudan and the newly independent nation of South Sudan.
South Sudan’s withdrawal has been ordered to create the environment for talks with Khartoum, Reuters news agency reports.
“An orderly withdrawal will commence immediately and shall be completed within three days,” AFP news agency quotes a presidential statement as saying.
Mr Kiir said the South still believed that Heglig was a part of South Sudan and that its final status should be determined by international arbitration, Associated Press reported.
Heglig is internationally accepted to be part of Sudanese territory – although the precise border is yet to be demarcated.
Uganda, a close ally of South Sudan, indicated that its military forces will join the fighting if a full-scale war ensues. But a Ugandan army spokesperson also said that diplomacy will be the first and primary method through which they plan to resolve the border issue between Sudan and its southern neighbor.