* South Sudan shut down its 350,000 bpd output in Jan 2012
* Sudan, South Sudan both depended heavily on oil revenue
* The two have agreed to withdraw troops from buffer zone (Adds details, analyst comment)
By Aaron Maasho and Hereward Holland
ADDIS ABABA/JUBA, March 12 (Reuters) - South Sudan will be able to resume oil production within three weeks, the oil minister said on Tuesday, after the country reached deals on border security with Sudan.
Landlocked South Sudan, which seceded from Sudan in July 2011, closed off its 350,000 barrel-per-day output in January last year in a row with Khartoum over how much it should pay to send the oil through Sudanese pipelines to the Red Sea.
Both countries rely on foreign currency from oil sales to import food and fuel, but border disputes and other issues left over from partition have prevented them resuming exports.
Diplomats and analysts cautioned that the two have made agreements before and failed to implement them.
Sudan's chief negotiator, Idris Mohammed Abdel Gadir, signed a deal with South Sudanese counterpart Pagan Amum early on Tuesday setting out a timeline to restart exports after four days of African Union-brokered talks in Addis Ababa.
Former South African president Thabo Mbeki, who has been mediating between the two sides, told reporters they had agreed to order oil companies to restart production within two weeks of "D-Day", given as Sunday, March 10.
A copy of the implementation timeline obtained by Reuters confirmed the date. "Resumption of production shall take place as soon as technically feasible," it said.
Speaking to reporters after returning from Addis Ababa, South Sudan's Petroleum and Mining Minister Stephen Dhieu Dau said there were few technical barriers to resuming oil output.
"We assume that we will resume as soon as possible," he said, adding it would take three weeks at most to resume output and no more than a further week for it to reach the export terminal in Port Sudan.
According to a technical assessment of the oil facilities, South Sudan will start oil production at 80 percent of pre-shutdown levels, Dau said.
In Khartoum, Awad Abdelfatah, undersecretary at Sudan's oil ministry, told Reuters orders had been given to oil firms to prepare to receive southern oil. He said he expected flows would not be less than 160,000 barrels a day at first.
The two former civil war enemies agreed at the talks in Addis Ababa on Friday to order the withdrawal of their troops from a demilitarised border zone within a week to ease tensions and open the way to resuming oil exports.
South Sudan's president has already given that order, an army spokesman said on Monday.
SETTING UP A BUFFER ZONE
The timetable said redeployment of forces from the border zone should be complete by April 5, and that the two countries should set up a committee by March 17 to set the boundary.
However, it did not set a date for determining the final status of Abyei, a disputed territory that has been a perennial source of tension between the two sides. An administration and council for the area would be set up by March 17, it said.
Nor did the deal finalise the ownership of five contested border areas, which will be referred to a non-binding African Union team of experts.
Interior ministers from both countries also planned to meet on March 17 to discuss how to open up border crossings and ease the movement of citizens between the two countries, Sudan's state news agency SUNA reported.
South Sudan accused Khartoum of blocking trade across the roughly 2,000-km (1,250-mile) border ahead of partition. The timeline said the two should immediately start managing a "soft border" to allow movement of people, goods and services.
Samson Wassara, a professor of political science at Juba University, said the agreement seemed to be the result of increasing strain on both sides since the shutdown.
"This time, I think the parties are agreeing under diplomatic pressure, but also under economic pressure and local political pressure," he said.
After teetering on the brink of full-scale conflict in April during the worst border clashes since splitting, the two countries agreed in September to set up the buffer zone but did not implement it.
Some 2 million people died in Sudan's decades-long north-south civil war, which ended with a 2005 peace deal that paved the way for the South's secession. (Writing by Alexander Dziadosz in Cairo; Additional reporting by Khalid Abdelaziz in Khartoum; editing by Jon Hemming and James Jukwey)