* Violence since mid-December has killed thousands
* Both sides given 24 hours to implement ceasefire
* WFP says thousands of tonnes of food aid looted
By Carl Odera
JUBA, Jan 24 (Reuters) - South Sudanese rebels said on Friday government forces had attacked their positions a day after the two sides signed a ceasefire deal, but the government denied the accusation.
Thursday night's agreement in neighbouring Ethiopia allowed for a 24-hour window for the ceasefire to take effect, meaning any clashes would not be in violation of an accord which took almost three weeks to negotiate.
But the reports of continuing conflict reflect the deep distrust between President Salva Kiir and rebel fighters, who include those loyal to former vice president Riek Machar as well as more autonomous groups.
"Kiir's forces' attacks on our defensive positions in Unity and Jonglei states are clear violations of the Cessation of Hostilities Agreement signed in Addis Ababa," said a statement signed by military spokesman Lul Ruai Koang.
He said the rebels had the right to defend themselves with force. But Kiir's spokesman dismissed the claim SPLA government soldiers had launched any strikes.
"There was no single gunshot anywhere and we hope the rebels will honour their signature," spokesman Ateny Wek Ateny told a news conference in the South Sudanese capital Juba.
The violence since mid-December, the worst in South Sudan since it won its independence from Sudan in 2011, has killed thousands of people and driven more than half a million from their homes.
The World Food Programme said on Friday looters had stolen more than 3,700 tonnes of food, enough to feed 220,000 people for a month. The U.N. agency said its warehouses in the northern town of Malakal had been almost emptied.
U.S. President Barack Obama said on Thursday the ceasefire was a critical first step towards peace in the world's newest state. But he added leaders needed to work to resolve the underlying causes of the conflict.
Diplomats say the deep ethnic, political and personal grievances will be hard to overcome.
Before the ceasefire was signed in talks mediated by the regional grouping IGAD, the rebel delegation had demanded that Ugandan forces involved in combat in support of government forces leave the country.
Thursday's agreement did not make explicit reference to Uganda but said both factions should withdraw all forces, including allied troops invited by either side, from the "theatre of operations". It did not make clear if foreign soldiers had to leave the country.
Ateny said the Ugandans had been deployed in South Sudan to ensure fighting did not spread into neighbouring countries. But their presence has unsettled some neighbouring states.
"We are happy that warring parties reached that ceasefire agreement and for us what IGAD decides is what we'll follow," Paddy Ankunda, the Ugandan military spokesman, told Reuters. (Additional reporting by Aaron Maasho; Writing by Duncan Miriri; Editing by Richard Lough and Andrew Roche)