South Sudan and Sudan must stop all military actions against each other and resolve their disputes through negotiations to avoid going back to war, U.S. President Barack Obama said, as he outlined what needs to be done to prevent the conflict from escalating further.

Addressing the people of Sudan and South Sudan in a videotaped message released Friday, Obama said that the heated rhetoric from the two countries has raised the risk of war, but conflict is not inevitable.

"It doesn't have to be this way...You still have a choice. You still have a chance to avoid being dragged back into war, which only leads to one place — more suffering; more refugees; more death; more lost dreams for you and your children," he said.

Obama said the government of Sudan must stop its military actions, including aerial bombardments in the South and it must give aid workers the access they need to save lives. Sudan must also end its support for armed groups inside the South, he said.

Likewise, he said the government of South Sudan must end its support for armed groups inside Sudan and it must cease its military actions across the border.

"And all those who are fighting including in Southern Kordofan and Blue Nile must recognize that there is no military solution. The only way to achieve real and lasting security is to resolve your differences through negotiation," Obama said.

Sudan and South Sudan have been drawing closer to a full scale war in recent months over the unresolved issues of sharing oil revenues and a disputed border. The disputes began even before the south seceded from the north in July 2011. The South's secession was part of a 2005 peace treaty which ended decades of war that killed 2 million people.

Sudan and South Sudan both claimed Friday to be in control of a contested oil town near the countries' ill-defined border after the south said it was withdrawing its troops to avert a return to war.

Last week, South Sudanese troops took over the border town of Heglig, which they call Panthou, sending Sudanese troops fleeing and sparking condemnation from the U.N., America and Britain.

Sudan's President Omar Al-Bashir on Wednesday threatened to topple the South Sudan government after accusing the south of trying to take down his Khartoum-based government. Al-Bashir continued his hardline rhetoric on Thursday in an address to a "popular defense" brigade headed to the Heglig area.

Negotiations between the two countries over the unresolved disputes that were being mediated by the African Union, broke down in Ethiopia earlier this month.

Obama said the presidents of Sudan and South Sudan must have the courage to resume negotiations and resolve the disputes peacefully.

"You will never be at peace if your neighbor feels threatened. You will never see development and progress if your neighbor refuses to be your partner in trade and commerce. It's easier to start wars than to end them," he said.